Jul 17, 2014, 10:16 AM
[CLOSED] Rowexpander nested gridpanel column width issue
Hello support
Great work on the frame work, really find ext.net to be a very powerful tool
I don't know if this is a know issue, but when you create a gridpanel and add a rowexpander and in that expander you add another gridpanel
The columns seem to have the incorrect width if the data in the cells are larger than the width off the columns.
if have made a test page where you can see the issue.
To make the issue appear you have to resize the column that is called "Message" in the inner grid once you have resized the column to be smaller then the data
inside its cell it will push the other columns so the rest of the data are placed incorrect.
Is there anything we can do to prevent this...
Test page is below:
Akpenob
Great work on the frame work, really find ext.net to be a very powerful tool
I don't know if this is a know issue, but when you create a gridpanel and add a rowexpander and in that expander you add another gridpanel
The columns seem to have the incorrect width if the data in the cells are larger than the width off the columns.
if have made a test page where you can see the issue.
To make the issue appear you have to resize the column that is called "Message" in the inner grid once you have resized the column to be smaller then the data
inside its cell it will push the other columns so the rest of the data are placed incorrect.
Is there anything we can do to prevent this...
Test page is below:
%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test.aspx.cs" Inherits="LIA.APP.WEB.LinkItAll.LiaLogin.Test" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<%@ Import Namespace="Panel=Ext.Net.Panel" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (X.IsAjaxRequest)
{
//We do not need to DataBind on an DirectEvent
return;
}
List<object> data = new List<object>();
for (int i = 1; i <= 25; i++)
{
data.Add(new { ID = "S_" + i, Name = "Suppiler " + i, Type = "T_" + i, Message = "M_" + i });
}
this.Store1.DataSource = data;
this.Store1.DataBind();
ResourceManager1.AddAfterClientInitScript(String.Format("Test._grdID ='{0}';", GridPanel1.ID));
}
</script>
<script type="text/javascript">
var Test = {};
Test._grdID = undefined;
Test.loadData = function (item, body, record) {
var grd = Ext.getCmp(Test._grdID);
if (grd) {
var list = [];
for(var i = 0; i < 10; i++){
var obj = {};
obj.Name = "Product "+i;
obj.Message = "AWDASDASI_" + i;
obj.Type = "A_"+i;
list.push(obj);
}
var store = grd.getStore();
store.loadData(list);
}
};
</script>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" ViewStateMode="Disabled"
EnableViewState="false" />
<ext:Window ID="wndTest" runat="server" Width="800" Height="600" Layout="FitLayout">
<Items>
<ext:GridPanel ID="grdTest" runat="server">
<Store>
<ext:Store ID="Store1" runat="server">
<Model>
<ext:Model ID="Model1" runat="server" IDProperty="ID">
<Fields>
<ext:ModelField Name="ID" />
<ext:ModelField Name="Name" />
<ext:ModelField Name="Type" />
<ext:ModelField Name="Message" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel>
<Columns>
<ext:Column Text="Name" DataIndex="Name" runat="server"></ext:Column>
<ext:Column Text="Type" ID="Column2" DataIndex="Type" runat="server"></ext:Column>
<ext:Column Text="Message" ID="Column5" DataIndex="Message" runat="server"></ext:Column>
</Columns>
</ColumnModel>
<Plugins>
<ext:RowExpander ID="RowExpander1" runat="server">
<Component>
<ext:GridPanel ID="GridPanel1" runat="server">
<Store>
<ext:Store ID="Store2" runat="server">
<Model>
<ext:Model ID="Model2" runat="server" IDProperty="ID">
<Fields>
<ext:ModelField Name="ID" />
<ext:ModelField Name="Name" />
<ext:ModelField Name="Type" />
<ext:ModelField Name="Message" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel>
<Columns>
<ext:Column Text="Name" ID="Column1" DataIndex="Name" runat="server"></ext:Column>
<ext:Column Text="Type" ID="Column3" DataIndex="Type" runat="server"></ext:Column>
<ext:Column Text="Message" ID="Column4" DataIndex="Message" runat="server"></ext:Column>
</Columns>
</ColumnModel>
</ext:GridPanel>
</Component>
<Listeners>
<BeforeExpand Handler="Test.loadData(item,body,record)"></BeforeExpand>
</Listeners>
</ext:RowExpander>
</Plugins>
</ext:GridPanel>
</Items>
</ext:Window>
</form>
</body>
</html>
Best regardsAkpenob
Last edited by Daniil; Jul 18, 2014 at 9:10 AM.
Reason: [CLOSED]