[CLOSED] columns display in wrong order

  1. #1

    [CLOSED] columns display in wrong order

    <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>
    Click image for larger version. 

Name:	QQ截图20131115154522.jpg 
Views:	11 
Size:	9.3 KB 
ID:	7212
    Last edited by Daniil; Nov 22, 2013 at 5:07 AM. Reason: [CLOSED]
  2. #2
    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?
  3. #3
    Quote Originally Posted by Daniil View Post
    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(CultureInfo.InvariantCulture))), dfsum = accVouchSubService.dfsumByListOfCwzz_AccVouchMain(accVouchMainService.GetByDdate(s.ToString(CultureInfo.InvariantCulture))), fpsum = accVouchSubService.fpsumByListOfCwzz_AccVouchMain(accVouchMainService.GetByDdate(s.ToString(CultureInfo.InvariantCulture))) });
                //   var pagingList = new Paging<System.DateTime>(data, total);
                e.Total = total; 
                s_AccVouchMain.DataSource = data;
                s_AccVouchMain.DataBind();
            }
    Click image for larger version. 

Name:	QQ截图20131118101339.jpg 
Views:	7 
Size:	101.2 KB 
ID:	7220
  4. #4
    I think this is a culprit:
    Stateful="True"
    It restores the previous state of columns' order.

Similar Threads

  1. Export data to excel - in order columns
    By tanju_yayak in forum 1.x Help
    Replies: 2
    Last Post: Mar 22, 2012, 7:40 AM
  2. Numberic and Date Filter Display Order
    By cwolcott in forum 1.x Help
    Replies: 4
    Last Post: Mar 21, 2012, 1:44 PM
  3. Replies: 2
    Last Post: Dec 07, 2011, 10:35 AM
  4. How to display gridpanel columns with order
    By zhangsir199 in forum 1.x Help
    Replies: 0
    Last Post: Apr 20, 2011, 9:00 AM
  5. Replies: 3
    Last Post: Dec 03, 2010, 5:27 PM

Posting Permissions