[CLOSED] Grouping doesn't group entire grid data...just current page.

  1. #1

    [CLOSED] Grouping doesn't group entire grid data...just current page.

    How can I make it so that when I group a grid, it groups all of the paged data, not just what is seen?

  2. #2

    RE: [CLOSED] Grouping doesn't group entire grid data...just current page.

    Hi,

    The store can groups data from all pages if you don't use proxy
    If you use proxy than you use remote paging. In this case you have to use RemoteGroup="true" and group data on the server side manually

    Here is the sample which shows grouping if no proxy
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
                this.Store1.DataSource = this.TestData;
                this.Store1.DataBind(); 
        }
    
        private object[] TestData
        {
            get
            {
                return new object[]
                {
                    new object[] { "3m Co", 5 },
                    new object[] { "Alcoa Inc", 4 },
                    new object[] { "Altria Group Inc", 5 },
                    new object[] { "American Express Company", 1 },
                    new object[] { "American International Group, Inc.", 1 },
                    new object[] { "AT&amp;T Inc.", 3 },
                    new object[] { "Boeing Co.", 2 },
                    new object[] { "Caterpillar Inc.", 2 },
                    new object[] { "Citigroup, Inc.", 3 },
                    new object[] { "E.I. du Pont de Nemours and Company", 1 },
                    new object[] { "Exxon Mobil Corp", 2 },
                    new object[] { "General Electric Company", 4 },
                    new object[] { "General Motors Corporation", 1 },
                    new object[] { "Hewlett-Packard Co.", 2 },
                    new object[] { "Honeywell Intl Inc", 4 },
                    new object[] { "Intel Corporation", 4 },
                    new object[] { "International Business Machines", 1 },
                    new object[] { "Johnson &amp; Johnson", 3 },
                    new object[] { "JP Morgan &amp; Chase &amp; Co", 2 },
                    new object[] { "McDonald\"s Corporation", 1 },
                    new object[] { "Merck &amp; Co., Inc.", 5 },
                    new object[] { "Microsoft Corporation", 3 },
                    new object[] { "Pfizer Inc", 2 },
                    new object[] { "The Coca-Cola Company", 4 },
                    new object[] { "The Home Depot, Inc.", 1 },
                    new object[] { "The Procter &amp; Gamble Company", 5 },
                    new object[] { "United Technologies Corporation", 5 },
                    new object[] { "Verizon Communications", 1 },
                    new object[] { "Wal-Mart Stores, Inc.", 4 }
                };
            }
        }
    </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></title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
    
            <ext:GridPanel
                ID="GridPanel1"
                runat="server" 
                StripeRows="true"
                Title="Array Grid" 
                Width="600" 
                Height="290"
                AutoExpandColumn="Company">
                <Store>
                    <ext:Store ID="Store1" runat="server" GroupField="price">
                        <Reader>
                            <ext:ArrayReader>
                                <Fields>
                                    <ext:RecordField Name="company" />
                                    <ext:RecordField Name="price" Type="Int" />
                                </Fields>
                            </ext:ArrayReader>
                        </Reader>
                    </ext:Store>
                </Store>
                <ColumnModel runat="server">
                    <Columns>
                        <ext:Column ColumnID="Company" Header="Company" Width="160" DataIndex="company" />
                        <ext:Column Header="Price" Width="75" DataIndex="price">                        
                        </ext:Column>                    
                    </Columns>
                </ColumnModel>
                <View>
                    <ext:GroupingView runat="server" />
                </View>
                <BottomBar>
                    <ext:PagingToolbar runat="server" PageSize="10" />
                </BottomBar>
            </ext:GridPanel>
        </form>
    </body>
    </html>
  3. #3

    RE: [CLOSED] Grouping doesn't group entire grid data...just current page.

    Hi Vlad,
    Does this also work in 8.2? Or do we need 1.0?
  4. #4

    RE: [CLOSED] Grouping doesn't group entire grid data...just current page.

    Hi,

    Yes, it works in 0.8.2 also (just need small syntax 0.8.2 changes, like move Store outside the Grid)
  5. #5

    RE: [CLOSED] Grouping doesn't group entire grid data...just current page.

    Can you give me an example of remote grouping?
  6. #6

    RE: [CLOSED] Grouping doesn't group entire grid data...just current page.

    Hi,

    Does the following post is useful?
    http://forums.ext.net/showthread.php?postid=25830.aspx

Similar Threads

  1. Replies: 2
    Last Post: Dec 22, 2011, 2:45 PM
  2. Replies: 13
    Last Post: Aug 11, 2011, 6:11 AM
  3. Replies: 1
    Last Post: Nov 18, 2010, 5:21 AM
  4. Replies: 1
    Last Post: Nov 10, 2010, 8:47 PM

Posting Permissions