Mar 19, 2009, 3:02 PM
[CLOSED] GridPanel Widths
Hello,
If you look at the below simplified example you will notice that the widths on the Columns are not listening to their set values, especially on the last column where I have set the width to be 100, it renders as half the GridPanel:
Example.aspx:
Timothy
If you look at the below simplified example you will notice that the widths on the Columns are not listening to their set values, especially on the last column where I have set the width to be 100, it renders as half the GridPanel:
Example.aspx:
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
protected void Projects_RefreshData(object sender, StoreRefreshDataEventArgs e)
{
Projects.DataSource = new object[] {
new object[] { 1, "Group 1", "Project 1", "Lorem ipsum", 1 },
new object[] { 2, "Group 1", "Project 2", "Lorem ipsum", 2 },
new object[] { 3, "Group 2", "Project 3", "Lorem ipsum", 0 },
new object[] { 4, "Group 2", "Project 4", "Lorem ipsum", 0 }
};
Projects.DataBind();
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Example</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager runat="server" EnablePartialRendering="true" />
<ext:ScriptManager runat="server" />
<ext:Store ID="Projects"
runat="server"
AutoLoad="true"
GroupField="Grouping"
IgnoreExtraFields="true"
OnRefreshData="Projects_RefreshData">
<Proxy>
<ext:DataSourceProxy />
</Proxy>
<Reader>
<ext:ArrayReader ReaderID="ProjectId">
<Fields>
<ext:RecordField Name="ProjectId" Type="Auto" />
<ext:RecordField Name="Grouping" />
<ext:RecordField Name="DisplayName" />
<ext:RecordField Name="Description" />
<ext:RecordField Name="Submissions" />
</Fields>
</ext:ArrayReader>
</Reader>
<SortInfo Field="DisplayName" />
</ext:Store>
<ext:Panel runat="server">
<Body>
<ext:FitLayout runat="server">
<ext:GridPanel ID="dgProjects"
runat="server"
StoreID="Projects"
AutoExpandColumn="DisplayName"
AutoHeight="true"
AutoWidth="true"
Border="false">
<ColumnModel>
<Columns>
<ext:Column ColumnID="Grouping" DataIndex="Grouping" />
<ext:Column ColumnID="DisplayName" DataIndex="DisplayName" Header="Project" />
<ext:CommandColumn ColumnID="Public" Width="100">
<Commands>
<ext:CommandFill />
<ext:GridCommand CommandName="Submit" StandOut="true" Text="Submit" />
</Commands>
</ext:CommandColumn>
</Columns>
</ColumnModel>
<View>
<ext:GroupingView runat="server"
ForceFit="true"
EnableGroupingMenu="false"
EnableRowBody="true"
HideGroupedColumn="true"
ShowGroupName="false">
<GetRowClass Handler="rowParams.body = record.data.Description ? '<div style=\'padding: 5px 10px;\'>' + record.data.Description + '
' : '';" />
</ext:GroupingView>
</View>
</ext:GridPanel>
</ext:FitLayout>
</Body>
</ext:Panel>
</form>
</body>
</html>
Cheers,Timothy