PDA

View Full Version : [CLOSED] GridPanel getState() gets only column ID



ViDom
Dec 09, 2013, 12:54 PM
Hello,
My Button gets grid state like this:


<ext:Button runat="server" ID="btnSubmitSettings" Hidden="False" Cls="list-button"
Icon="ScriptSave" ToolTip="Save table" Width="30">
<DirectEvents>
<Click OnEvent="btnSubmitSettings_Click">
<ExtraParams>
<ext:Parameter Name="setting" Value="Ext.encode(#{GridPanelMain}.getState())"
Mode="Raw">
</ext:Parameter>
</ExtraParams>
</Click>
</DirectEvents>
</ext:Button>

and on the server side:


protected void btnSubmitSettings_Click(object sender,DirectEventArgs e)
{
string json = e.ExtraParams["setting"];
}

but the json string looks like this:


"{\"columns\":[{\"id\":\"header-1296\"},{\"id\":\"ctl00_siteContent_dlInvoices_Column_Number\"},{\"id\":\"ctl00_siteContent_dlInvoices_Column_ContractNumber \"},{\"id\":\"ctl00_siteContent_dlInvoices_Column_ContractorName \"},{\"id\":\"ctl00_siteContent_dlInvoices_Column_Date\"},{\"id\":\"ctl00_siteContent_dlInvoices_Column_Settled\"},{\"id\":\"ctl00_siteContent_dlInvoices_Column_GrossValue\"},{\"id\":\"ctl00_siteContent_dlInvoices_Column_Desc\"}],\"storeState\":{\"sorters\":[{\"root\":\"data\",\"property\":\"Settled\",\"direction\":\"ASC\"}]}}"

Why there is no width parameter? By the way GridPanel is generated dynamic, if it make any difference.

Daniil
Dec 09, 2013, 3:47 PM
Hi @ViDom,

It doesn't put a Column's Width into the state if it equals the initial Width. If you change a column's width, it should be in the state.

ViDom
Dec 09, 2013, 3:57 PM
In Ext.NET v 1.X it was functioning in the same way?

Baidaly
Dec 09, 2013, 11:46 PM
Hello!

No, in Ext.NET 1.x the state always has width value of each column. But it's unnecessary information if you don't change initial width because you always know initial width.

ViDom
Dec 10, 2013, 11:14 PM
Ok, you are right, it's not a problem.
Thread can be closed