[CLOSED] Grid Panel Grouping Issue

  1. #1

    [CLOSED] Grid Panel Grouping Issue

    Dear Members,
    I am facing an issue regarding grouping in Grid Panel. Grid Panel Shows with no error but when I click on "show in Groups"(with a specified Field).

    It shows in Groups with repeated Same Field Value Which should be unique.
    For example I have field Priority which has three values Low,Medium,High

    Result should be in three groups but It shows me 5 and more Groups.

    This is my Grid.
    <ext:GridPanel ID="GridPanel_Requests" runat="server" IDMode="Explicit">                                    
                        <ColumnModel ID="ColumnModel1" runat="server">
                            <Columns>
                                <ext:Column ColumnID="col_RequestID" DataIndex="Id" Header="ID">
                                </ext:Column>
                                <ext:Column ColumnID="col_Subject" DataIndex="Subject" Header="Subject" Width="350px">
                                </ext:Column>
                                <ext:Column ColumnID="col_Responsible" Groupable="true" DataIndex="ResponsibleName"
                                    Header="Responsible" Width="150px">
                                </ext:Column>
                                <ext:Column ColumnID="col_User" DataIndex="UserName" Header="User" Width="150px">
                                </ext:Column>
                                <ext:Column ColumnID="col_Priority" DataIndex="PriorityDesc" Header="Priority" Width="100px">
                                </ext:Column>
                                <ext:Column ColumnID="col_Category" DataIndex="CategoryName" Header="Category" Width="250px">
                                </ext:Column>
                                <ext:CommandColumn Width="25" Hideable="false">
                                    <Commands>
                                        <ext:GridCommand CommandName="edit" Icon="ApplicationFormEdit">
                                            <ToolTip Text="Edit" />
                                        </ext:GridCommand>
                                    </Commands>
                                    <PrepareToolbar Handler="toolbar.setVisible(!record.newRecord);" />
                                </ext:CommandColumn>
                            </Columns>
                        </ColumnModel>
                        <View>
                            <ext:GroupingView   ID="GroupingView1" HideGroupedColumn="true" runat="server" ForceFit="true"
                                StartCollapsed="true" GroupTextTpl='<span id="ColorCode-{[values.rs[0].data.ColorCode]}"></span>{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Items" : "Item"]})'
                                EnableRowBody="true"  EnableGrouping="true" >
                                <Listeners>
                                    <Refresh Fn="setGroupStyle" />                                
                                </Listeners>
                            </ext:GroupingView>                                                
                        </View>                    
                        <SelectionModel>
                            <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true">
                            </ext:RowSelectionModel>
                        </SelectionModel>
                        <BottomBar>
                            <ext:PagingToolbar ID="PagingToolbar1" runat="server" PageSize="24">
                            </ext:PagingToolbar>
                        </BottomBar>
                        <Listeners>
                            <Command Handler="Request.setIndex(this,rowIndex);#{btnRequestEdit}.fireEvent('click',#{btnEdit})" />
                        </Listeners>
                        <Plugins>
                            <ext:GridFilters ID="gridfilters" runat="server" Local="false">
                                <Filters>
                                    <ext:NumericFilter DataIndex="Id" />
                                    <ext:StringFilter DataIndex="Subject" />
                                    <ext:StringFilter DataIndex="ResponsibleName">
                                    </ext:StringFilter>
                                    <ext:StringFilter DataIndex="UserName">
                                    </ext:StringFilter>
                                    <ext:ListFilter DataIndex="PriorityDesc" Options="ASAP,High,Normal,Low,Very Low">
                                    </ext:ListFilter>
                                    <ext:StringFilter DataIndex="CategoryName">
                                    </ext:StringFilter>
                                </Filters>
                            </ext:GridFilters>
                        </Plugins>
                    </ext:GridPanel>
    This is my Store

    <ext:Store ID="Store_Request" runat="server" AutoDataBind="true" RemoteSort="true">
        <Proxy>
            <ext:HttpProxy Method="GET" />
        </Proxy>
        <Reader>
            <ext:JsonReader IDProperty="Id" Root="rows" TotalProperty="total">
                <Fields>
                    <ext:RecordField Name="Id" Mapping="Id" SortDir="ASC" />
                    <ext:RecordField Name="Subject" Mapping="Subject" />
                    <ext:RecordField Name="CategoryName" Mapping="Category.Name" />
                    <ext:RecordField Name="CategoryId" Mapping="Category.Id" />
                    <ext:RecordField Name="Category2Id" Mapping="Category2.Id" />
                    <ext:RecordField Name="Category3Id" Mapping="Category3.Id" />
                    <ext:RecordField Name="PriorityId" Mapping="priority.Id" />
                    <ext:RecordField Name="PriorityDesc" Mapping="priority.description" />
                    <ext:RecordField Name="Estimated" Mapping="Estimated" />
                    <ext:RecordField Name="DeadLine" Mapping="DeadLine" Type="Date" DateFormat="M$" />
                    <ext:RecordField Name="ExpectedDate" Mapping="ExpectedDate" Type="Date" DateFormat="M$" />
                    <ext:RecordField Name="Reminder" Mapping="Reminder" Type="Date" DateFormat="M$" />
                    <ext:RecordField Name="Completed" Mapping="Completed" />
                    <ext:RecordField Name="ILocation" Mapping="ILocation" />
                    <ext:RecordField Name="ResponsibleName" Mapping="Responsible.User_Name" />
                    <ext:RecordField Name="StatusId" Type="Int" />
                    <ext:RecordField Name="ResponsibleId" Mapping="Responsible.Id" />
                    <ext:RecordField Name="UserName" Mapping="User.User_Name" />
                    <ext:RecordField Name="UserId" Mapping="User.Id" />
                    <ext:RecordField Name="projectName" Mapping="project.Name" />
                    <ext:RecordField Name="projectId" Mapping="project.Id" />
                    <ext:RecordField Name="problem" Mapping="Problem" />
                    <ext:RecordField Name="Solution" Mapping="Solution" />
                    <ext:RecordField Name="Update" Mapping="Update" />
                    <ext:RecordField Name="Delete" Mapping="Delete" />
                    <ext:RecordField Name="Type" Mapping="Type" />
                </Fields>
            </ext:JsonReader>
        </Reader>    
        <BaseParams>
            <ext:Parameter Name="limit" Value="24" Mode="Raw" />
            <ext:Parameter Name="start" Value="0" Mode="Raw" />
            <ext:Parameter Name="dir" Value="ASC" />
            <ext:Parameter Name="sort" Value="Id" />
            <ext:Parameter Name="gridfilters" Value="" />
        </BaseParams>
        <SortInfo Field="Id" Direction="ASC" />
    </ext:Store>
    a print shot is attached
    Attached Thumbnails Click image for larger version. 

Name:	grouping error.GIF 
Views:	168 
Size:	56.4 KB 
ID:	3697  
    Last edited by Daniil; Jan 16, 2012 at 9:15 AM. Reason: [CLOSED]
  2. #2
    Hi,

    When you choose the "Show in groups" option of a column, the records are grouped by that column.

    To get the records initially grouped by a required column, please set up a respective GroupField for a Store.
    <ext:Store runat="server" GroupField="Priority">
  3. #3
    Hi Daniil,
    I think, I am not able to demonstrate my problem. If you see the attachment you will understand the problem, The Problem is that the Groups which should be only 4 are displaying 12.
    it is only grouping if consecutive records have same Field Value when next Field Value is different it makes another group but it should check if there already created a group for same value then it should add the record to existing Group.
    Attached Thumbnails Click image for larger version. 

Name:	grouping error.GIF 
Views:	128 
Size:	56.4 KB 
ID:	3700  
  4. #4
    Thanks for the clarification.

    Regarding to my post:
    Quote Originally Posted by Daniil View Post
    When you choose the "Show in groups" option of a column, the records are grouped by that column.
    What column do you click "Show in groups" option?

    Generally, I can't reproduce the problem using the example below - the records appear to be grouped correctly.

    Could you confirm that example works for you as expected?

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                Store store = this.GridPanel1.GetStore();
                store.DataSource = new object[] 
                { 
                    new object[] { "LOW", "testLow11", "testLow12" },
                    new object[] { "NORMAL", "testNormal11", "testNormal12" },
                    new object[] { "HIGH", "testHigh11", "testHigh12" },
                    new object[] { "ASAP", "testAsap11", "testAsap12" },
                    new object[] { "LOW", "testLow21", "testLow22" },
                    new object[] { "NORMAL", "testNormal21", "testNormal22" },
                    new object[] { "HIGH", "testHigh21", "testHigh22" },
                    new object[] { "ASAP", "testAsap21", "testAsap22" },
                    new object[] { "LOW", "testLow31", "testLow32" },
                    new object[] { "NORMAL", "testNormal31", "testNormal32" },
                    new object[] { "HIGH", "testHigh31", "testHigh32" },
                    new object[] { "ASAP", "testAsap31", "testAsap32" },
                };
                store.DataBind();
            }
        }
    </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">
                        <Reader>
                            <ext:ArrayReader>
                                <Fields>
                                    <ext:RecordField Name="priority" />
                                    <ext:RecordField Name="test1" />
                                    <ext:RecordField Name="test2" />
                                </Fields>
                            </ext:ArrayReader>
                        </Reader>
                    </ext:Store>
                </Store>
                <ColumnModel runat="server">
                    <Columns>
                        <ext:Column Header="Priority" DataIndex="priority" />
                        <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>
  5. #5
    Dear Daniil,
    I click on Priority Column,
    Yes Your given example is working fine. but let me confirm you i m using remote filtering, remote sorting, and remote paging. whether these are producing these issues.
  6. #6
    I don't think these things might break client side grouping. But not 100% sure.

    Please try the following:

    1. Set up HideGroupedColumn="false" for the GroupingView.

    2. Try to group clicking on "Show in groups" of the Priority column.

    3. Post a screen-shot, like the previous one.
  7. #7
    Thanks Daniil,
    I have found the Problem and it is solved now.

    The Problem is that i am making Objects in controller at server side and in store i m mapping the objects and making multiple RecordFields with single object.

    For solution I removed mappings in store and at making objects in controller i made different properties for different record fields.

Similar Threads

  1. Replies: 1
    Last Post: Jan 17, 2014, 4:43 PM
  2. [CLOSED] Problem with Grid Panel Grouping Commands (0.8.3)
    By vedagopal2004 in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Nov 03, 2010, 3:26 PM
  3. Replies: 1
    Last Post: Sep 10, 2010, 10:57 AM
  4. [CLOSED] Dynamic Grid, Sorting and Grouping Issue
    By SymSure in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 16, 2010, 2:06 PM
  5. Grid to grid Drag and Drop grouping issue
    By bobs in forum 1.x Help
    Replies: 0
    Last Post: Feb 10, 2009, 8:13 AM

Posting Permissions