May 04, 2012, 10:02 AM
[CLOSED] Strange behavior of grid row when cells contains cells command
Hello
see that code :
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...)
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]