Using Ext.NET v1.3, I need to ADD a User Control to each Tab dynamically...

Page 2 of 2 FirstFirst 12
  1. #11

    Look at the updated Example, I updated my sample "completeness" according to your suggestion you gave below...

    Basically once the user switches to another Tab, I want to remove the previous User Control and Load it back again to the ACTIVE TAB...

    I could have one (1) tab or ten (10) tabs which ALL would be loaded with the SAME User Control, so I don't wanna load ALL TABS, but ONLY 1 when ever it becomes Active.

    Look at my example below... The issue is the TEXTBOX in the example below DOES NOT load within the TAB, it loads up OUTSIDE which in INCORRECT...

    <%@ Page Language="C#" %>
    
    <%@ Import Namespace="System.Collections.Generic" %>
    <%@ Import Namespace="Panel=Ext.Net.Panel" %>
    <%@ Register Assembly="Ext.Net" TagPrefix="ext" Namespace="Ext.Net" %>
    
    <script runat="server">    
    
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                Session["previousTab"] = null;
    
                var lines = new List<string>() { "Line 1", "Line 2", "Line 3", "Line 4" };
                int[] index = { 1 };
                foreach (var line in lines)
                {
                    //* NEW Tab Panel */                 
                    var tab = new Panel
                    {
                        ID = "TabBreadLine_" + index[0],
                        AutoHeight = true,
                        Title = line,
                        Padding = 6
                    };
    
                    // ONLY loads the FIRST TAB...
                    if (index[0] == 1)
                    {
                        //var userControl = LoadControl("~/UserControls/Runs.ascx");
                        //userControl.ID = "LineUserControl_" + index[0];
    
                        //* NEW Label */                 
                        var label = new Ext.Net.Label
                        {
                            ID = "Label_" + index[0],
                            Text = line,
                            FieldLabel = line
                        };
                        tab.ContentControls.Add(label);
                    }
    
                    tab.Listeners.Activate.Handler = "Ext.net.DirectMethods.LoadActiveTab('" + line + "'," + index[0] + ");";
                    TabBakeryLines.Items.Add(tab);
                    index[0]++;
                }
            }
        }
    
        [DirectMethod]
        public void LoadActiveTab(string line, string index)
        {
            if (Session["previousTab"] != null)
            {
                X.Msg.Notify("The Server Time is: ", DateTime.Now.ToLongTimeString()).Show();
    
                var previousTab = X.GetCmp<Panel>("TabBreadLine_" + Session["previousTab"]);
                previousTab.ClearContent();
    
                // *************************************************************
    
                var activeTab = X.GetCmp<Panel>("TabBreadLine_" + index);
                //var uc = LoadControl("~/UserControls/test.ascx");
                //uc.ID = "LineUserControl_" + index;
    
                //* NEW Label */                 
                var label = new Ext.Net.Label
                {
                    ID = "Label_" + index[0],
                    Text = line,
                    FieldLabel = line
                };
    
                activeTab.ContentControls.Add(label);
                activeTab.UpdateContent();
            }
            Session["previousTab"] = index;
        }
        
    </script>
    
    <html>
    <head>
        <title>Example of Issue </title>
    </head>
    <body>
        <form id="Form1" runat="server">
        <ext:ResourceManager ID="ResourceManager1" runat="server" />
        <ext:TabPanel ID="TabBakeryLines" runat="server" AutoHeight="true" StyleSpec="padding-left:2px;" />
        </form>
    </body>
    </html>

    Quote Originally Posted by geoffrey.mcgill View Post
    I'm not really sure what this means? What is the UseCase for this scenario? You want to move the content of Tab1 to Tab2 when you click on Tab2?
    Last edited by RonaldR; May 17, 2012 at 6:07 AM. Reason: Updated Sample...
  2. #12
    Turns out the way to accomplish this with the current v1/v2 builds is not as clean as I would like.

    The sample below demonstrates how to get it working in v1. There are a couple key changes to your original design:

    1. moving the event handler to the TabPanels <TabChange> event. Using the <Activate> event on the individual Tabs may/will create a chain reaction endless loop as each new Tab becomes active, which then triggers the <Activate> event to fire, triggering the next Tab to Activate.

    2. Adding a Container inside the Tab/Panel, then adding the TextBox (regular ASP.NET Controls) to the .ContentControls Collection of the Container.

    We also discovered an issue with how the scripts are sequenced, which requires the following line to be added in order to make this whole scenario work correctly:

    this.TabPanel1.AddScript("Panel{0}.removeAll();", index);
    We're hoping to have this script sequencing issue fixed right away, so the above line could eventually be coded in pure C#.

    There were many other minor revisions, but I'll let you work through the following sample to compare with your original.

    NOTE: All this aside, I'm still not 100% sure why you need create/re-create your Controls in this manner, but either way it does appear possible with a few changes.

    Example

    <%@ Page Language="C#" %> <%@ Import Namespace="System.Collections.Generic" %>
    <%@ Import Namespace="Panel=Ext.Net.Panel" %>
     
     
    <%@ Register Assembly="Ext.Net" TagPrefix="ext" Namespace="Ext.Net" %>
      
    <script runat="server">    
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                this.Session["previousTab"] = null;
     
     
                var lines = new List<int>() { 1, 2, 3, 4 };
     
     
                for (int i = 1; i <= lines.Count; i += 1)
                {
                    //* NEW Tab Panel */                 
                    var tab = new Panel
                    {
                        ID = "Panel" + i,
                        Title = "Panel" + i,
                        Padding = 5
                    };
     
     
                    // ONLY loads the FIRST TAB...
                    if (i == 1)
                    {
                        var container = new Container();
                         
                        //* NEW TextBox */                 
                        var textBox = new TextBox
                        {
                            ID = "TextBox" + i,
                            Text = "TextBox" + i
                        };
     
     
                        container.ContentControls.Add(textBox);
                        tab.Items.Add(container);
                    }
     
     
                    this.TabPanel1.Items.Add(tab);
                }
            }
        }
         
        [DirectMethod]
        public void LoadActiveTab(int index)
        {
            if (this.Session["previousTab"] != null)
            {
                var previousTab = X.GetCmp<Panel>("Panel" + this.Session["previousTab"]);
                previousTab.Items.Clear();
     
                var activeTab = X.GetCmp<Panel>("Panel" + index);
    
    
                // if using SVN build....
                activeTab.RemoveAll();
    
    
                // otherwise, must call manually...
                //this.TabPanel1.AddScript("Panel{0}.removeAll();", index);
     
                var container = new Container { ID = "Container" + index };
                 
                /* NEW TextBox */
                var textBox = new TextBox
                {
                    ID = "TextBox" + index,
                    Text = "TextBox" + index
                };
     
     
                container.ContentControls.Add(textBox);
                container.AddTo(activeTab);
                 
                this.TabPanel1.ActiveIndex = index - 1;
            }
             
            this.Session["previousTab"] = index;
        }
    </script>
      
    <html>
    <head runat="server">
        <title>Ext.NET Example</title>
    </head>
    <body>
    <form runat="server">
        <ext:ResourceManager runat="server" />
     
     
        <ext:TabPanel ID="TabPanel1" runat="server" Height="215" Width="500">
            <Listeners>
                <TabChange Handler="Ext.net.DirectMethods.LoadActiveTab(this.items.indexOf(tab) + 1);" />
            </Listeners>
        </ext:TabPanel>
    </form>
    </body>
    </html>
    Hope this helps.
    Last edited by geoffrey.mcgill; May 18, 2012 at 7:27 PM.
    Geoffrey McGill
    Founder
  3. #13

    DOCTYPE Issue with rendering page...

    Yes, that works as expected.

    Now when I load up the User Control, when there is nested Panel, the components DOES NOT show up on the screen!

    REASON:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    I need to have the "DOCTYPE" on my page because my style and other control will be out of alignment...

    If you REMOVE
    "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">"

    It works BUT, other alignment issues occurs...


    <%@ Page Language="C#" %>
    
    <%@ Import Namespace="System.Collections.Generic" %>
    <%@ Import Namespace="Panel=Ext.Net.Panel" %>
    <%@ Register Assembly="Ext.Net" TagPrefix="ext" Namespace="Ext.Net" %>
    
    <script runat="server">         
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                Session["previousTab"] = null;
                var lines = new List<string>() { "Line 1", "Line 2", "Line 3", "Line 4" };
                for (int i = 1; i <= lines.Count; i += 1)
                {
                    //* NEW Tab Panel */                               
                    var tab = new Panel
                    {
                        ID = "Panel" + i,
                        Title = lines[i - 1],
                        Padding = 5
                    };
    
                    // ONLY loads the FIRST TAB...                
                    if (i == 1)
                    {
                        var container = new Container();
    
                        /* NEW TextBox */                                    
                        //var textBox = new TextBox
                        //                  {
                        //                      ID = "TextBox" + i,
                        //                      Text = "TextBox" + i
                        //                  };
    
                        var userControl = (UserControl)LoadControl("~/UserControls/testCtr.ascx");
                        userControl.ID = "LineUserControl_" + 1;
    
                        container.ContentControls.Add(userControl);
                        tab.Items.Add(container);
                    }
                    TabPanel1.Items.Add(tab);
                }
            }
        }
    
        [DirectMethod]
        public void LoadActiveTab(int index)
        {
            if (Session["previousTab"] != null)
            {
                var previousTab = X.GetCmp<Panel>("Panel" + Session["previousTab"]);
                previousTab.Items.Clear();
                TabPanel1.AddScript("Panel{0}.removeAll();", index);
                var activeTab = X.GetCmp<Panel>("Panel" + index);
                var container = new Container { ID = "Container" + index };
    
                /* NEW TextBox */
                //var textBox = new TextBox
                //                  {
                //                      ID = "TextBox" + index,
                //                      Text = "TextBox" + index
                //                  };
    
                var userControl = (UserControl)LoadControl("~/UserControls/testCtr.ascx");
                userControl.ID = "LineUserControl_" + index;
    
                container.ContentControls.Add(userControl);
                container.AddTo(activeTab);
                TabPanel1.ActiveIndex = index - 1;
            }
    
            Session["previousTab"] = index;
        } 
        
    </script>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
    <head id="Head1" runat="server">
        <title>Ext.NET Example</title>
    </head>
    <body>
        <form id="Form1" runat="server">
        <ext:ResourceManager ID="ResourceManager1" runat="server" />
        <ext:TabPanel ID="TabPanel1" runat="server" Height="215" Width="500">
            <Listeners>
                <TabChange Handler="Ext.net.DirectMethods.LoadActiveTab(this.items.indexOf(tab) + 1);" />
            </Listeners>
        </ext:TabPanel>
        </form>
    </body>
    </html>
    .ascx
    %@ Control Language="C#" %>
    <ext:Panel ID="PanelOuter" runat="server" BodyPadding="5" Frame="true" Icon="None">
        <Items>
            <ext:ColumnLayout ID="ColumnLayout1" runat="server">
                <Columns>
                    <ext:LayoutColumn>
                        <ext:Panel ID="PanelInner" runat="server" BodyBorder="false" Height="500">
                            <Items>
                                <ext:Label runat="server" ID="test" Text="testing Display 1" />
                            </Items>
                        </ext:Panel>
                    </ext:LayoutColumn>
                </Columns>
            </ext:ColumnLayout>
        </Items>
    </ext:Panel>

    Quote Originally Posted by geoffrey.mcgill View Post
    Turns out the way to accomplish this with the current v1/v2 builds is not as clean as I would like.

    The sample below demonstrates how to get it working in v1. There are a couple key changes to your original design:

    1. moving the event handler to the TabPanels <TabChange> event. Using the <Activate> event on the individual Tabs may/will create a chain reaction endless loop as each new Tab becomes active, which then triggers the <Activate> event to fire, triggering the next Tab to Activate.

    2. Adding a Container inside the Tab/Panel, then adding the TextBox (regular ASP.NET Controls) to the .ContentControls Collection of the Container.

    We also discovered an issue with how the scripts are sequenced, which requires the following line to be added in order to make this whole scenario work correctly:

    this.TabPanel1.AddScript("Panel{0}.removeAll();", index);
    We're hoping to have this script sequencing issue fixed right away, so the above line could eventually be coded in pure C#.

    There were many other minor revisions, but I'll let you work through the following sample to compare with your original.

    NOTE: All this aside, I'm still not 100% sure why you need create/re-create your Controls in this manner, but either way it does appear possible with a few changes.

    Example

    <%@ Page Language="C#" %> 
    <%@ Import Namespace="System.Collections.Generic" %>
    <%@ Import Namespace="Panel=Ext.Net.Panel" %>
    
    
    <%@ Register Assembly="Ext.Net" TagPrefix="ext" Namespace="Ext.Net" %>
     
    <script runat="server">    
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                this.Session["previousTab"] = null;
    
    
                var lines = new List<int>() { 1, 2, 3, 4 };
    
    
                for (int i = 1; i <= lines.Count; i += 1)
                {
                    //* NEW Tab Panel */                 
                    var tab = new Panel
                    {
                        ID = "Panel" + i,
                        Title = "Panel" + i,
                        Padding = 5
                    };
    
    
                    // ONLY loads the FIRST TAB...
                    if (i == 1)
                    {
                        var container = new Container();
                        
                        //* NEW TextBox */                 
                        var textBox = new TextBox
                        {
                            ID = "TextBox" + i,
                            Text = "TextBox" + i
                        };
    
    
                        container.ContentControls.Add(textBox);
                        tab.Items.Add(container);
                    }
    
    
                    this.TabPanel1.Items.Add(tab);
                }
            }
        }
        
        [DirectMethod]
        public void LoadActiveTab(int index)
        {
            if (this.Session["previousTab"] != null)
            {
                var previousTab = X.GetCmp<Panel>("Panel" + this.Session["previousTab"]);
                previousTab.Items.Clear();
    
    
                this.TabPanel1.AddScript("Panel{0}.removeAll();", index);
                
                var activeTab = X.GetCmp<Panel>("Panel" + index);
    
    
                var container = new Container { ID = "Container" + index };
                
                /* NEW TextBox */
                var textBox = new TextBox
                {
                    ID = "TextBox" + index,
                    Text = "TextBox" + index
                };
    
    
                container.ContentControls.Add(textBox);
                container.AddTo(activeTab);
                
                this.TabPanel1.ActiveIndex = index - 1;
            }
            
            this.Session["previousTab"] = index;
        }
    </script>
     
    <html>
    <head runat="server">
        <title>Ext.NET Example</title>
    </head>
    <body>
    <form runat="server">
        <ext:ResourceManager runat="server" />
    
    
        <ext:TabPanel ID="TabPanel1" runat="server" Height="215" Width="500">
            <Listeners>
                <TabChange Handler="Ext.net.DirectMethods.LoadActiveTab(this.items.indexOf(tab) + 1);" />
            </Listeners>
        </ext:TabPanel>
    </form>
    </body>
    </html>
    Hope this helps.
  4. #14
    It appears this is just a bit of a layout timing issue.

    You can workaround by setting AutoDoLayout="true" on your "PanelOuter". That will force the "PanelOuter" to call .doLayout() after it's finished rendering.

    Hope this helps.
    Geoffrey McGill
    Founder
  5. #15

    The control with ID 'Button1' not found

    Yes that helps the rendering issue, now I get an Error saying, "The control with ID 'Button1' not found"

    Errors:
    1. The control with ID 'Button1' not found
    2. On the Second Tab, "The control with ID 'LineUserControl_2_Button1' not found"


    .aspx
    <%@ Page Language="C#" %>
    
    <%@ Import Namespace="System.Collections.Generic" %>
    <%@ Import Namespace="Panel=Ext.Net.Panel" %>
    <%@ Register Assembly="Ext.Net" TagPrefix="ext" Namespace="Ext.Net" %>
    
    <script runat="server">         
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                Session["previousTab"] = null;
                var lines = new List<string>() { "Line 1", "Line 2", "Line 3", "Line 4" };
                for (int i = 1; i <= lines.Count; i += 1)
                {
                    //* NEW Tab Panel */                               
                    var tab = new Panel
                    {
                        ID = "TabBreadLine_" + i,
                        Title = lines[i - 1],
                        Padding = 5
                    };
    
                    // ONLY loads the FIRST TAB...                
                    if (i == 1)
                    {
                        var container = new Container();
    
                        /* NEW TextBox */
                        //var textBox = new TextBox
                        //                  {
                        //                      ID = "TextBox" + i,
                        //                      Text = "TextBox" + i
                        //                  };
    
                        var userControl = (UserControl)LoadControl("~/UserControls/testCtr.ascx");
                        userControl.ID = "LineUserControl_" + 1;
    
                        container.ContentControls.Add(userControl);
                        tab.Items.Add(container);
                    }
                    TabBakeryLines.Items.Add(tab);
                }
            }
        }
    
        [DirectMethod]
        public void LoadActiveTab(int index)
        {
            //X.Msg.Notify("The Server Time is: ", DateTime.Now.ToLongTimeString()).Show();
    
            if (Session["previousTab"] != null)
            {
                var previousTab = X.GetCmp<Panel>("TabBreadLine_" + Session["previousTab"]);
                previousTab.Items.Clear();
                TabBakeryLines.AddScript("TabBreadLine_{0}.removeAll();", Session["previousTab"]);
    
                // *************************************************************
    
                var activeTab = X.GetCmp<Panel>("TabBreadLine_" + index);
                var container = new Container { ID = "ContainerBreadLine_" + index };
    
                var userControl = (UserControl)LoadControl("~/UserControls/testCtr.ascx");
                userControl.ID = "LineUserControl_" + index;
    
                container.ContentControls.Add(userControl);
                container.AddTo(activeTab);
                TabBakeryLines.ActiveIndex = (index - 1);
            }
    
            Session["previousTab"] = index;
        } 
        
    </script>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title>Ext.NET Example</title>
    </head>
    <body>
        <form id="Form1" runat="server">
        <ext:ResourceManager ID="ResourceManager1" runat="server" />
        <ext:TabPanel ID="TabBakeryLines" runat="server" Height="215" Width="500">
            <Listeners>
                <TabChange Handler="Ext.net.DirectMethods.LoadActiveTab(this.items.indexOf(tab) + 1);" />
            </Listeners>
        </ext:TabPanel>
        </form>
    </body>
    </html>
    .ascx (Updated User Control)
    <%@ Control Language="C#" %>
    
    <script type="text/javascript">
        var showResult = function(btn) {
            Ext.Msg.notify("Button Click", "You clicked the " + btn + " button");
        };
    
    </script>
    
    
    <script runat="server">
    
        protected void Button1_Click(object sender, DirectEventArgs e)
        {
            X.Msg.Show(new MessageBoxConfig
            {
                Title = "Save Changes?",
                Message = "You are closing a tab that has unsaved changes. <br />Would you like to save your changes?",
                Buttons = MessageBox.Button.YESNOCANCEL,
                Icon = MessageBox.Icon.QUESTION,
                Fn = new JFunction { Fn = "showResult" },
                AnimEl = Button1.ClientID
            });
        }
        
    </script>
    
    <ext:Panel ID="PanelOuter" runat="server" BodyPadding="5" Frame="true" Icon="None"
        AutoDoLayout="true">
        <Items>
            <ext:ColumnLayout ID="ColumnLayout1" runat="server">
                <Columns>
                    <ext:LayoutColumn>
                        <ext:Panel ID="PanelInner" runat="server" BodyBorder="false" Height="500">
                            <Items>
                                <ext:Button ID="Button1" runat="server" Text="Show">
                                    <DirectEvents>
                                        <Click OnEvent="Button1_Click" />
                                    </DirectEvents>
                                </ext:Button>
                            </Items>
                        </ext:Panel>
                    </ext:LayoutColumn>
                </Columns>
            </ext:ColumnLayout>
        </Items>
    </ext:Panel>

    Quote Originally Posted by geoffrey.mcgill View Post
    It appears this is just a bit of a layout timing issue.

    You can workaround by setting AutoDoLayout="true" on your "PanelOuter". That will force the "PanelOuter" to call .doLayout() after it's finished rendering.

    Hope this helps.
    Last edited by RonaldR; May 21, 2012 at 5:18 AM. Reason: Added the .aspx Page
  6. #16

    After rewrite control from usercontrol to Ext.Net javascript error occured

    Hi,

    After I rewrite a control which have inside a bunch of other ext.net controls like in mockup I've provide:

    Click image for larger version. 

Name:	mockup.png 
Views:	178 
Size:	9.6 KB 
ID:	4789

    I've got javascript error which said me nothing.

    SyntaxError: invalid object initializer
    I've made this control using this https://examples1.ext.net/#/Combinat.../Simple_Tasks/

    here's code of this control:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;
    using System.Linq;
    using System.Text;
    using System.Web;
    using Ext.Net;
    
    namespace Sample
    {
        public partial class LinkedListFormExt : BorderLayout
        {
            private Ext.Net.Panel northPanel;
            private Ext.Net.Panel centerPanel;
            private Ext.Net.GridPanel gridPanelMain;
            private Ext.Net.Store store;
            private Ext.Net.PagingToolbar pagingToolbar;
    
            private Ext.Net.Hidden fieldGridDataPrnExp;
            private Ext.Net.Hidden fieldSelectedIds;
    
            #region buttons
    
            private Ext.Net.Button btnCreate;
            private Ext.Net.Button btnDelete;
            private Ext.Net.Button btnReload;
    
            #endregion
    
            public void Configure()
            {
                ConfigurePanels(ConfigureButtons());
            }
    
            private List<Ext.Net.Button> ConfigureButtons()
            {
                btnCreate = new Ext.Net.Button { ID = "btnCreateLinked" + this.ID, Icon = Icon.Add };
                btnCreate.DirectClick+=new ComponentDirectEvent.DirectEventHandler(btnCreate_DirectClick);
                btnDelete = new Ext.Net.Button { ID = "btnDeleteLinked" + this.ID, Icon = Icon.Delete };
                btnDelete.DirectClick += new ComponentDirectEvent.DirectEventHandler(btnDelete_DirectClick);
                btnReload = new Ext.Net.Button { ID = "btnReloadLinked" + this.ID, Icon = Icon.Reload };
                btnReload.Listeners.Click.Handler = "#{gridPanelMain"+this.ID+"}.store.reload();";
                return new List<Button>{btnCreate,btnDelete,btnReload};
            }
    
    
            private void ConfigurePanels(List<Ext.Net.Button> buttons)
            {
                fieldGridDataPrnExp = new Ext.Net.Hidden { ID = "fieldGridDataPrnExp" + this.ID };
                fieldSelectedIds = new Ext.Net.Hidden { ID = "fieldSelectedIds" + this.ID };
                northPanel = new Ext.Net.Panel { ID = "northPanelLinked"+this.ID, Height = 70, Header = false, Split = true, Collapsible = false };
                northPanel.Items.AddRange(buttons);
                northPanel.Items.Add(new Hidden { ID = "scrollStore" + this.ID });
                this.North.Items.Add(northPanel);
    
                gridPanelMain = new Ext.Net.GridPanel { ID = "gridPanelMain" + this.ID, SelectionMemory = SelectionMemoryMode.Enabled, AnchorHorizontal = "100%", Cls = "grid-sample" };
                store = new Ext.Net.Store { ID = "storeMain" + this.ID, RemoteSort = true };
                store.AutoLoadParams.AddRange(
                    new List<Parameter>
                        {
                            new Parameter{Name="start", Value="0" ,Mode=ParameterMode.Raw},
                            new Parameter{Name="limit", Value="50" ,Mode=ParameterMode.Raw},
                            new Parameter{Name="sort", Value=""},
                            new Parameter{Name="dir", Value=""}
                        });
                store.SortInfo.Field = "Id";
                store.SortInfo.Direction = SortDirection.DESC;
                pagingToolbar = new PagingToolbar { ID = "pagingToolbar" + this.ID, PageSize = 50, DisplayInfo = true, DisplayMsg = "Rows {0} - {1} of {2}", EmptyMsg = "empty" };
                //SlidingPager slidingPager = new SlidingPager();
                //pagingToolbar.Plugins.Add(slidingPager);
                gridPanelMain.Store.Add(store);
                gridPanelMain.BottomBar.Add(pagingToolbar);
                gridPanelMain.DirectEvents.RowDblClick.Before = "#{scrollStore"+this.ID+"}.setValue(this.view.scroller.dom.scrollTop);";
                gridPanelMain.DirectEvents.RowDblClick.Event += new ComponentDirectEvent.DirectEventHandler(RowDblClick_Event);
                gridPanelMain.DirectEvents.RowDblClick.ExtraParams.Add(new Parameter{Name = "grow",Value = "this.store.getAt(rowIndex).data['Id']",Mode = ParameterMode.Raw});
                gridPanelMain.DirectEvents.RowDblClick.EventMask.ShowMask = true;
                gridPanelMain.DirectEvents.RowDblClick.EventMask.Msg = "Please wait...";
                Ext.Net.GridView gridView = new Ext.Net.GridView { ID = "gridView" + this.ID, StandardHeaderRow = true };
                gridView.GetRowClass.Handler = "if (record.data.CssClass != '') return record.data.CssClass;";
                gridView.Listeners.Refresh.Handler="restoreScroll(this, #{scrollStore"+this.ID+"});";
                gridView.Listeners.Refresh.Delay = 10;
                gridView.Listeners.Refresh.Single = true;
                gridPanelMain.View.Add(gridView);
                //ConfigureGridPanelMain();
                centerPanel = new Ext.Net.Panel { ID = "centerPanelLinked" + this.ID, Header = false, AnchorHorizontal = "100%", Collapsible = false, Split = true, Layout = "Fit" };
                centerPanel.Items.Add(gridPanelMain);
                this.Center.Items.Add(centerPanel);
            }
    
            protected void RowDblClick_Event(object sender, DirectEventArgs e)
            {
    
            }
            protected void btnCreate_DirectClick(object sender, DirectEventArgs e)
            {
                
            }
    
            protected void btnDelete_DirectClick(object sender, DirectEventArgs e)
            {
            }
        }
    }
    Any ideas what could cause this error of javascript?

    Thanks,
    ViDom
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Replies: 0
    Last Post: May 16, 2012, 11:29 PM
  2. Replies: 2
    Last Post: Dec 08, 2011, 1:00 PM
  3. Replies: 0
    Last Post: May 03, 2010, 4:33 AM
  4. [CLOSED] Add Tab dynamically which contains user control
    By pschojer in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 04, 2009, 1:18 PM
  5. Dynamically loading a user control
    By kene in forum 1.x Help
    Replies: 0
    Last Post: Mar 16, 2009, 7:28 AM

Tags for this Thread

Posting Permissions