[CLOSED] Strange behavior of grid row when cells contains cells command

  1. #1

    [CLOSED] Strange behavior of grid row when cells contains cells command

    Hello

    see that code :
    <%@ Page Language="C#" %>
    *
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    *
    <script runat="server">
    ****protected void Page_Load(object sender, EventArgs e)
    ****{
    ********if (!X.IsAjaxRequest)
    ********{
    ************Store store = this.GridPanel1.GetStore();
    ************store.DataSource = new object[] 
    ************{ 
    ****************new object[] { "group1", "1", "1" },
    ****************new object[] { "group1", "11", "11" },
    ****************new object[] { "group1", "111", "111" },
    ****************new object[] { "group2", "2", "2" },
    ****************new object[] { "group2", "22", "22" },
    ****************new object[] { "group2", "222", "222" }
    ************};
    ************store.DataBind();
                Store store2 = this.GridPanel2.GetStore();
                store2.DataSource = new object[] 
    ************{ 
    ****************new object[] { "group1", "1", "1" },
    ****************new object[] { "group1", "11", "11" },
    ****************new object[] { "group1", "111", "111" },
    ****************new object[] { "group2", "2", "2" },
    ****************new object[] { "group2", "22", "22" },
    ****************new object[] { "group2", "222", "222" }
    ************};
                store2.DataBind();
            }
    ****}
    </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 v2 Example</title>
    </head>
    <body>
    ****<ext:ResourceManager ID="ResourceManager1" runat="server" />
    
        <ext:TabPanel runat="server">
            <Items>            
                <ext:Panel ID="Panel1" runat="server">
                    <Content>
                        <ext:GridPanel ID="GridPanel1" runat="server" AutoHeight="true">
    ********                <Store>
    ************                <ext:Store ID="Store1" runat="server" GroupField="groupId">
    ****************                <Model>
    ********************                <ext:Model ID="Model1" runat="server">
    ************************                <Fields>
    ****************************                <ext:ModelField Name="groupId" />
    ****************************                <ext:ModelField Name="test1" />
    ****************************                <ext:ModelField Name="test2" />
    ************************                </Fields>
    ********************                </ext:Model>
    ****************                </Model>
    ************                </ext:Store>
    ********                </Store>
    ********                <ColumnModel ID="ColumnModel1" runat="server">
    ************                <Columns>
    ****************                <ext:Column ID="Column1" runat="server" Text="GroupId" DataIndex="groupId">
                                    </ext:Column>
    ****************                <ext:Column ID="Column2" runat="server" Text="Test1" DataIndex="test1" >
                                        <Commands>
                                            <ext:ImageCommand CommandName="Edit" Icon="NoteAdd">
                                                <ToolTip Text="add a comment" />
                                            </ext:ImageCommand>
                                            <ext:ImageCommand CommandName="Target" Icon="ControlRecord">
                                                <ToolTip Text="Add/modify target" />
                                            </ext:ImageCommand>
                                            <ext:ImageCommand CommandName="Measured" Icon="Eye">
                                                <ToolTip Text="Measured/Estimated value" />
                                            </ext:ImageCommand>
                                        </Commands>    
                                    </ext:Column>
    ****************                <ext:Column ID="Column3" runat="server" Text="Test2" DataIndex="test2" >
                                        <Commands>
                                            <ext:ImageCommand CommandName="Edit" Icon="NoteAdd">
                                                <ToolTip Text="add a comment" />
                                            </ext:ImageCommand>
                                            <ext:ImageCommand CommandName="Target" Icon="ControlRecord">
                                                <ToolTip Text="Add/modify target" />
                                            </ext:ImageCommand>
                                            <ext:ImageCommand CommandName="Measured" Icon="Eye">
                                                <ToolTip Text="Measured/Estimated value" />
                                            </ext:ImageCommand>
                                        </Commands>    
                                    </ext:Column>
    ************                </Columns>
    ********                </ColumnModel>
    ********                <Features>
    ************                <ext:Grouping ID="Grouping1" runat="server" StartCollapsed="false" />
    ********                </Features>
    ********                <Listeners>
    ************                <%--Workaround--%>
    ************                <ViewReady Handler="this.features[0].expandAll();" />
    ********                </Listeners>
    ****                </ext:GridPanel>
                    </Content>
                </ext:Panel>
                <ext:Panel ID="Panel2" runat="server">
                    <Content>
                        <ext:GridPanel ID="GridPanel2" runat="server" AutoHeight="true">
    ********                <Store>
    ************                <ext:Store ID="Store2" runat="server" GroupField="groupId">
    ****************                <Model>
    ********************                <ext:Model ID="Model2" runat="server">
    ************************                <Fields>
    ****************************                <ext:ModelField Name="groupId" />
    ****************************                <ext:ModelField Name="test1" />
    ****************************                <ext:ModelField Name="test2" />
    ************************                </Fields>
    ********************                </ext:Model>
    ****************                </Model>
    ************                </ext:Store>
    ********                </Store>
    ********                <ColumnModel ID="ColumnModel2" runat="server">
    ************                <Columns>
    ****************                <ext:Column ID="Column4" runat="server" Text="GroupId" DataIndex="groupId" />
    ****************                <ext:Column ID="Column5" runat="server" Text="Test1" DataIndex="test1" />
    ****************                <ext:Column ID="Column6" runat="server" Text="Test2" DataIndex="test2" />
    ************                </Columns>
    ********                </ColumnModel>
    ********                <Features>
    ************                <ext:Grouping ID="Grouping2" runat="server" StartCollapsed="false" />
    ********                </Features>
    ********                <Listeners>
    ************                <%--Workaround--%>
    ************                <ViewReady Handler="this.features[0].expandAll();" />
    ********                </Listeners>
    ****                </ext:GridPanel>
                    </Content>
                </ext:Panel>
            </Items>
        </ext:TabPanel>
    ****
    ****<ext:Button ID="Button1"
    ********runat="server"
    ********Text="Expand the first group">
    ********<Listeners>
    ************<Click Handler="#{GridPanel1}.features[0].expand('group1');" />
    ********</Listeners>*** 
    ****</ext:Button>
    *
    ****<ext:Button ID="Button2"
    ********runat="server"
    ********Text="Expand the second group">
    ********<Listeners>
    ************<Click Handler="#{GridPanel1}.features[0].expand('group2');" />
    ********</Listeners>*** 
    ****</ext:Button>
    </body>
    </html>
    First change pane to show the grid (I don't know why they are not shown at launch, but it is not the bug). In first grid, remove one column, change pane and come again on first pane. See the row height. If you hide groupId column, nothing happen because it have no cell command, but with other cells bug happen.

    If cells contains cells command and grids are in tab panel, then when changing panel when column are hidden conduct to grid rows not drawn with good height (without changig column size of course).

    If you unhide hiden column, then the drawing is good.

    (why I have stars in the code? it is the first time I see that...)
    Last edited by Daniil; May 09, 2012 at 9:22 AM. Reason: [CLOSED]
  2. #2
    Hi,

    Can I remove the following thread as it looks to be a duplicate?
    http://forums.ext.net/showthread.php?18777
  3. #3
    Oh...Seems I made a mistake...Of course you can
  4. #4
    I can't run the code dye to these '*' in the code. Could you re-format?
  5. #5
    Quote Originally Posted by Daniil View Post
    I can't run the code dye to these '*' in the code. Could you re-format?
    Please se :

    (why I have stars in the code? it is the first time I see that...)
    Else do a replace all "*" by "space", I try to made my copy several times and I always ave the stars. I retry :

    <%@ Page Language="C#" %>
     
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
     
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                Store store = this.GridPanel1.GetStore();
                store.DataSource = new object[] 
                { 
                    new object[] { "group1", "1", "1" },
                    new object[] { "group1", "11", "11" },
                    new object[] { "group1", "111", "111" },
                    new object[] { "group2", "2", "2" },
                    new object[] { "group2", "22", "22" },
                    new object[] { "group2", "222", "222" }
                };
                store.DataBind();
                Store store2 = this.GridPanel2.GetStore();
                store2.DataSource = new object[] 
                { 
                    new object[] { "group1", "1", "1" },
                    new object[] { "group1", "11", "11" },
                    new object[] { "group1", "111", "111" },
                    new object[] { "group2", "2", "2" },
                    new object[] { "group2", "22", "22" },
                    new object[] { "group2", "222", "222" }
                };
                store2.DataBind();
            }
        }
    </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 v2 Example</title>
    </head>
    <body>
        <ext:ResourceManager ID="ResourceManager1" runat="server" />
     
        <ext:TabPanel ID="TabPanel1" runat="server">
            <Items>            
                <ext:Panel ID="Panel1" runat="server">
                    <Content>
                        <ext:GridPanel ID="GridPanel1" runat="server" AutoHeight="true">
                            <Store>
                                <ext:Store ID="Store1" runat="server" GroupField="groupId">
                                    <Model>
                                        <ext:Model ID="Model1" runat="server">
                                            <Fields>
                                                <ext:ModelField Name="groupId" />
                                                <ext:ModelField Name="test1" />
                                                <ext:ModelField Name="test2" />
                                            </Fields>
                                        </ext:Model>
                                    </Model>
                                </ext:Store>
                            </Store>
                            <ColumnModel ID="ColumnModel1" runat="server">
                                <Columns>
                                    <ext:Column ID="Column1" runat="server" Text="GroupId" DataIndex="groupId">
                                    </ext:Column>
                                    <ext:Column ID="Column2" runat="server" Text="Test1" DataIndex="test1" >
                                        <Commands>
                                            <ext:ImageCommand CommandName="Edit" Icon="NoteAdd">
                                                <ToolTip Text="add a comment" />
                                            </ext:ImageCommand>
                                            <ext:ImageCommand CommandName="Target" Icon="ControlRecord">
                                                <ToolTip Text="Add/modify target" />
                                            </ext:ImageCommand>
                                            <ext:ImageCommand CommandName="Measured" Icon="Eye">
                                                <ToolTip Text="Measured/Estimated value" />
                                            </ext:ImageCommand>
                                        </Commands>    
                                    </ext:Column>
                                    <ext:Column ID="Column3" runat="server" Text="Test2" DataIndex="test2" >
                                        <Commands>
                                            <ext:ImageCommand CommandName="Edit" Icon="NoteAdd">
                                                <ToolTip Text="add a comment" />
                                            </ext:ImageCommand>
                                            <ext:ImageCommand CommandName="Target" Icon="ControlRecord">
                                                <ToolTip Text="Add/modify target" />
                                            </ext:ImageCommand>
                                            <ext:ImageCommand CommandName="Measured" Icon="Eye">
                                                <ToolTip Text="Measured/Estimated value" />
                                            </ext:ImageCommand>
                                        </Commands>    
                                    </ext:Column>
                                </Columns>
                            </ColumnModel>
                            <Features>
                                <ext:Grouping ID="Grouping1" runat="server" StartCollapsed="false" />
                            </Features>
                            <Listeners>
                                <%--Workaround--%>
                                <ViewReady Handler="this.features[0].expandAll();" />
                            </Listeners>
                        </ext:GridPanel>
                    </Content>
                </ext:Panel>
                <ext:Panel ID="Panel2" runat="server">
                    <Content>
                        <ext:GridPanel ID="GridPanel2" runat="server" AutoHeight="true">
                            <Store>
                                <ext:Store ID="Store2" runat="server" GroupField="groupId">
                                    <Model>
                                        <ext:Model ID="Model2" runat="server">
                                            <Fields>
                                                <ext:ModelField Name="groupId" />
                                                <ext:ModelField Name="test1" />
                                                <ext:ModelField Name="test2" />
                                            </Fields>
                                        </ext:Model>
                                    </Model>
                                </ext:Store>
                            </Store>
                            <ColumnModel ID="ColumnModel2" runat="server">
                                <Columns>
                                    <ext:Column ID="Column4" runat="server" Text="GroupId" DataIndex="groupId" />
                                    <ext:Column ID="Column5" runat="server" Text="Test1" DataIndex="test1" />
                                    <ext:Column ID="Column6" runat="server" Text="Test2" DataIndex="test2" />
                                </Columns>
                            </ColumnModel>
                            <Features>
                                <ext:Grouping ID="Grouping2" runat="server" StartCollapsed="false" />
                            </Features>
                            <Listeners>
                                <%--Workaround--%>
                                <ViewReady Handler="this.features[0].expandAll();" />
                            </Listeners>
                        </ext:GridPanel>
                    </Content>
                </ext:Panel>
            </Items>
        </ext:TabPanel>
        
        <ext:Button ID="Button1"
            runat="server"
            Text="Expand the first group">
            <Listeners>
                <Click Handler="#{GridPanel1}.features[0].expand('group1');" />
            </Listeners>    
        </ext:Button>
     
        <ext:Button ID="Button2"
            runat="server"
            Text="Expand the second group">
            <Listeners>
                <Click Handler="#{GridPanel1}.features[0].expand('group2');" />
            </Listeners>    
        </ext:Button>
    </body>
    </html>
    Ah, works in preview post function, I copy/pase from pspad this time.
  6. #6
    Quote Originally Posted by feanor91 View Post
    First change pane to show the grid (I don't know why they are not shown at launch, but it is not the bug).
    Please use Items instead of Content.

    Quote Originally Posted by feanor91 View Post
    In first grid, remove one column, change pane and come again on first pane. See the row height. If you hide groupId column, nothing happen because it have no cell command, but with other cells bug happen.

    If cells contains cells command and grids are in tab panel, then when changing panel when column are hidden conduct to grid rows not drawn with good height (without changig column size of course).

    If you unhide hiden column, then the drawing is good.
    Reproduced. We are investigating.

    Quote Originally Posted by feanor91 View Post
    (why I have stars in the code? it is the first time I see that...)
    Yes, sometimes it happens. I'm not sure why. At least I have never reproduced that behavior. Maybe, it is related to what you are coping the code from.

    And yes, copy, paste to some simple redactor first like NotePad commonly helps.
  7. #7
    The problem appears to be difficult to fix immediately. It will take some time.

    We will notice you when we will come up with a fix.
  8. #8
    OK, no problem, I will wait.
  9. #9
    The fix has been added to SVN. Please update and re-test.
  10. #10
    Hello

    It works perfectly, thank you very much.

Similar Threads

  1. Editable Grid Panel Cells Values
    By garag in forum 1.x Help
    Replies: 0
    Last Post: Sep 20, 2011, 3:29 PM
  2. Tooltip for cells in particular level of tree grid
    By rajputamit in forum 1.x Help
    Replies: 0
    Last Post: Nov 15, 2010, 9:08 AM
  3. Tooltip for cells in particular level of tree grid
    By rajputamit in forum 1.x Help
    Replies: 0
    Last Post: Nov 11, 2010, 10:26 AM
  4. Multiline Grid Cells
    By Duclos in forum 1.x Help
    Replies: 1
    Last Post: May 04, 2010, 5:48 AM
  5. [CLOSED] Components in grid cells
    By acrossdev in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Jun 17, 2009, 1:37 AM

Posting Permissions