PDA

View Full Version : [CLOSED] columns display in wrong order



tobros
Nov 15, 2013, 7:46 AM
<ColumnModel>
<Columns>
<ext:DateColumn runat="server" DataIndex="Ddate" Format="yyyy-MM-dd" Text="日期">
</ext:DateColumn>
<ext:NumberColumn ID="DateColumn1" runat="server" DataIndex="jfsum" Text="借方金额">
</ext:NumberColumn>
<ext:NumberColumn ID="NumberColumn2" runat="server" DataIndex="dfsum" Flex="1" Text="贷方金额">
</ext:NumberColumn>
</Columns>
</ColumnModel>

7212

Daniil
Nov 15, 2013, 11:12 AM
Hi @tobros,

I put that ColumnModel into my test GridPanel, but it doesn't reproduce the issue.

Could you, please, provide a full test case to reproduce?

tobros
Nov 18, 2013, 2:18 AM
Hi @tobros,

I put that ColumnModel into my test GridPanel, but it doesn't reproduce the issue.

Could you, please, provide a full test case to reproduce?

i try to write a test case , but i do not know how to convert "data" (array of json) to list of object , how to write?
below is my code and picture


<ext:GridPanel ID="gp_xjllxx" Stateful="True" runat="server" Title="现金流量数据调整">
<Store>
<ext:Store runat="server" ID="s_AccVouchMain" OnReadData="LoadData" PageSize="20">
<Model>
<ext:Model ID="Model1" runat="server" IDProperty="Ddate">
<Fields>
<ext:ModelField runat="server" Name="Ddate"></ext:ModelField>
<ext:ModelField runat="server" Name="jfsum"></ext:ModelField>
<ext:ModelField runat="server" Name="dfsum"></ext:ModelField>
<ext:ModelField runat="server" Name="fpsum"></ext:ModelField>

</Fields>
</ext:Model>
</Model>
<Proxy>
<ext:PageProxy></ext:PageProxy>
</Proxy>
</ext:Store>

</Store>
<ColumnModel>
<Columns>
<ext:DateColumn ID="DateColumn1" runat="server" DataIndex="Ddate" Format="yyyy-MM-dd" Text="日期">
</ext:DateColumn>
<ext:NumberColumn ID="NumberColumn1" runat="server" DataIndex="jfsum" Text="借方金额">
</ext:NumberColumn>
<ext:NumberColumn ID="NumberColumn2" runat="server" DataIndex="dfsum" Text="贷方金额">
</ext:NumberColumn>
<ext:NumberColumn ID="NumberColumn3" runat="server" DataIndex="fpsum" Flex="1" Text="分配金额">
</ext:NumberColumn>
</Columns>
</ColumnModel>


</ext:GridPanel>



protected void LoadData(object sender, StoreReadDataEventArgs e)
{
int start = e.Start;
int limit = e.Limit;
int total = 0;
var l = accVouchMainService.PageDdate(start, limit, out total);
var data = l.Select(s => new { Ddate = s, jfsum = accVouchSubService.jfsumByListOfCwzz_AccVouchMain( accVouchMainService.GetByDdate(s.ToString(CultureI nfo.InvariantCulture))), dfsum = accVouchSubService.dfsumByListOfCwzz_AccVouchMain( accVouchMainService.GetByDdate(s.ToString(CultureI nfo.InvariantCulture))), fpsum = accVouchSubService.fpsumByListOfCwzz_AccVouchMain( accVouchMainService.GetByDdate(s.ToString(CultureI nfo.InvariantCulture))) });
// var pagingList = new Paging<System.DateTime>(data, total);
e.Total = total;
s_AccVouchMain.DataSource = data;
s_AccVouchMain.DataBind();
}


7220

Daniil
Nov 18, 2013, 7:13 AM
I think this is a culprit:

Stateful="True"

It restores the previous state of columns' order.