[CLOSED] RemoteSort="True" Breaks Groupping

  1. #1

    [CLOSED] RemoteSort="True" Breaks Groupping

    Hi,

    We have experienced an error here whereby if we enable RemoteSort="True" on the Store it will break the auto-regrouping on the grid. Can you please help?

    Thanks.
    Danny
    Last edited by Daniil; Apr 19, 2012 at 7:38 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Please clarify do you use Ext.NET v2?
  3. #3
    We use Ext.Net V1.3 here.

    Quote Originally Posted by Daniil View Post
    Hi,

    Please clarify do you use Ext.NET v2?
  4. #4
    Thanks for the clarification.

    Do you use remote or local grouping?
  5. #5
    I tried RemoteGrouping but it doesn't work.
  6. #6
    Well, but what grouping do you need - remote or local?
  7. #7
    Either grouping mode would be sufficient if it works.


    Quote Originally Posted by Daniil View Post
    Well, but what grouping do you need - remote or local?
  8. #8
    Ok, lets consider local grouping first.

    It seems to be functioned correctly in the example below.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        public static List<object> TestData = new List<object>()
        { 
            new 
            {
                groupId = "group1", 
                test1 = "1", 
                test2 = "1" 
            },
            new 
            {
                groupId = "group1", 
                test1 = "11", 
                test2 = "11" 
            },new 
            {
                groupId = "group1", 
                test1 = "111", 
                test2 = "111" 
            },
            new 
            {
                groupId = "group2", 
                test1 = "2", 
                test2 = "2" 
            },
            new 
            {
                groupId = "group2", 
                test1 = "22", 
                test2 = "22" 
            },
            new 
            {
                groupId = "group2", 
                test1 = "222", 
                test2 = "222" 
            },
        };
    
        protected void Store_RefreshData(object sender, StoreRefreshDataEventArgs e)
        {
            Store store = sender as Store;
    
            List<object> data = TestData;
            
            if (!string.IsNullOrEmpty(e.Sort))
            {
                data.Sort(delegate(object x, object y)
                {
                    object a;
                    object b;
    
                    int direction = e.Dir == Ext.Net.SortDirection.DESC ? -1 : 1;
    
                    a = x.GetType().GetProperty(e.Sort).GetValue(x, null);
                    b = y.GetType().GetProperty(e.Sort).GetValue(y, null);
                    return CaseInsensitiveComparer.Default.Compare(a, b) * direction;
                });
            }
    
            store.DataSource = data;
        }
    </script>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.NET Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:GridPanel ID="GridPanel1" runat="server" AutoHeight="true">
                <Store>
                    <ext:Store 
                        runat="server" 
                        GroupField="groupId" 
                        OnRefreshData="Store_RefreshData" 
                        RemoteSort="true">
                        <Proxy>
                            <ext:PageProxy />
                        </Proxy>
                        <Reader>
                            <ext:JsonReader>
                                <Fields>
                                    <ext:RecordField Name="groupId" />
                                    <ext:RecordField Name="test1" />
                                    <ext:RecordField Name="test2" />
                                </Fields>
                            </ext:JsonReader>
                        </Reader>
                    </ext:Store>
                </Store>
                <ColumnModel runat="server">
                    <Columns>
                        <ext:Column Header="GroupId" DataIndex="groupId" />
                        <ext:Column Header="Test1" DataIndex="test1" />
                        <ext:Column Header="Test2" DataIndex="test2" />
                    </Columns>
                </ColumnModel>
                <View>
                    <ext:GroupingView runat="server" HideGroupedColumn="true" />
                </View>
            </ext:GridPanel>
        </form>
    </body>
    </html>
    Please provide your test case.

Similar Threads

  1. [CLOSED] Hidden="true" behaves as Visible="false"
    By marco.morreale in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: May 28, 2012, 3:17 PM
  2. Replies: 5
    Last Post: May 02, 2012, 5:37 PM
  3. [CLOSED] Best practice clearing filters when Stateful="true"
    By CarWise in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jan 24, 2012, 2:23 PM
  4. [CLOSED] DropDownField with Grow="true" and GrowMax="xxx"
    By deejayns in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jan 12, 2012, 12:00 PM
  5. [CLOSED] Save File dialogbox coming when IsUPload="true"
    By webppl in forum 1.x Legacy Premium Help
    Replies: 11
    Last Post: May 17, 2011, 10:35 AM

Tags for this Thread

Posting Permissions