[CLOSED] GridPanel with grouping and expand/collapse issue

  1. #1

    [CLOSED] GridPanel with grouping and expand/collapse issue

    Hi Guys,
    I have a GridPanel which has grouping and also expand/collapse all functionality. Initial render of the grid is correct but I find that the expand/collapse causes the grouping headers to be rendered incorrectly. I can demonstrate this using your GridPanel -> GridPanel_Commands -> Group_Command MVC example. If you add the following code to the example Index.cshtml, you can see what I mean.

    Add a top bar with the expand/collapse buttons :-

          .TopBar(
              Html.X().Toolbar()
                  .Flat(true)
                  .Items(
                      Html.X().ToolbarFill(),
    
                      Html.X().Button()
                          .Icon(Icon.BulletPlus)
                          .Text("Expand All")
                          .Handler("this.up('gridpanel').getView().getFeature('UserCompElementsGrouping').expandAll();"),
    
                      Html.X().Button()
                          .Icon(Icon.BulletMinus)
                          .Text("Collapse All")
                          .Handler("this.up('gridpanel').getView().getFeature('UserCompElementsGrouping').collapseAll();"),
    
                      Html.X().ToolbarSpacer().Width(30)
                  )
          ) /* -- end of top bar items -- */
    Then give the Features -> Grouping an ID as used in the handler above :-

            .Features(
                Html.X().Grouping()
                    .ID("UserCompElementsGrouping")
                    .HideGroupedHeader(true)
                    .GroupHeaderTplString("{columnName}: {name} ({[values.rows.length]} {[values.rows.length > 1 ? \"Items\" : \"Item\"]})"),
                
                Html.X().RowBody().GetAdditionalData("getAdditionalData"),
                
                Html.X().RowWrap()
            )
    Refresh the page and click the expand/collapse buttons.
    Last edited by Daniil; May 20, 2014 at 7:56 AM. Reason: [CLOSED]
  2. #2
    Hi @ATLAS,

    Please look at the screenshots here.
    http://forums.ext.net/showthread.php?33091

    Is it the same issue?
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi @ATLAS,

    Please look at the screenshots here.
    http://forums.ext.net/showthread.php?33091

    Is it the same issue?


    It is not quite the same. Using the Ext.Net example. On initial render you get :-

    Click image for larger version. 

Name:	Ext.Net Grouping 1.png 
Views:	30 
Size:	18.4 KB 
ID:	10741

    If you then expand all :-

    Click image for larger version. 

Name:	Ext.Net Grouping 2.png 
Views:	36 
Size:	20.4 KB 
ID:	10751

    The if you collapse all you get :-

    Click image for larger version. 

Name:	Ext.Net Grouping 3.png 
Views:	23 
Size:	8.4 KB 
ID:	10761


    If you collapse each group individually then all is OK.
  4. #4
    Ok. Though, I think there is the same reason. A Grouping and a RowBody cannot be used together. Sorry for the inconvenience.
  5. #5
    Quote Originally Posted by Daniil View Post
    Ok. Though, I think there is the same reason. A Grouping and a RowBody cannot be used together. Sorry for the inconvenience.
    OK, as a workaround, what would be the best way to iterate the group and cause a group expand/collapse individually from "expandAll / collapseAll" buttons click handlers? I assume I can do that.
  6. #6
    I think it is what the expandAll method already does. It iterates the groups and expand each.
    http://docs.sencha.com/extjs/4.2.1/s...thod-expandAll

Similar Threads

  1. Replies: 0
    Last Post: Mar 06, 2014, 5:41 AM
  2. Issue with GridPanel grouping Column
    By rishu in forum 2.x Help
    Replies: 0
    Last Post: Jun 11, 2013, 11:19 AM
  3. GridPanel grouping issue
    By milenios in forum 2.x Help
    Replies: 2
    Last Post: Aug 07, 2012, 6:58 PM
  4. Grouping - Disable Collapse - Help?!?!?
    By Tbaseflug in forum 2.x Help
    Replies: 0
    Last Post: May 25, 2012, 6:03 PM
  5. grid grouping prevent collapse
    By [WP]joju in forum 1.x Help
    Replies: 4
    Last Post: Jan 18, 2010, 1:03 AM

Posting Permissions