[CLOSED] TreeGrid - grouping rows

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    [CLOSED] TreeGrid - grouping rows

    Hi Support,

    I'm using Ext.Net 4.5.1 with Asp.Net MVC. I've used grouping for the regular grid in the past by adding feature as follows,

      .Features(
                        Html.X().GroupingSummary()
                            .ID("GroupingSummary1")
                            .GroupHeaderTplString("{name}")
                            //.HideGroupedHeader(true)
                            .EnableGroupingMenu(false)                        
               )
    But this doesn't work with TreeGrid, is there anyway to make TreeGrid support grouping?

    Thanks,
    Gunvant
    Last edited by fabricio.murta; May 08, 2018 at 5:23 PM.
  2. #2
    Hello @fahd!

    The tree grid already implements an inherent grouping mechanism by the folders (non-leaf nodes) expanding and collapsing, and this would just conflict with the grouping plug in.

    I can't see a trivial way on grouping a tree grid, but I can't say it is just impossible to develop the functionality. But nevertheless, extending a client-side component (and maybe a server-side class) would most likely be the way to do that.

    If what you want is the grouping summary row alone, it may be possible to attain the summation by just using a custom handler to walk thru the displayed rows, for example showing the sum of values in just the rows that are not collapsed, or accounting only the rows marked as 'leaves' (the end points).

    If you can work on a simple test case that illustrates your page with the elements it should have and you point what's missing in the end result, maybe we could help with some more pinpointed ideas.
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Thanks Fabricio,

    That's what I thought too, I'll just use node as grouping mechanism.

    I have related question, I want to have all first level node expanded initially so I'm adding child records along with root level nodes and setting Expanded property to true. And they renders expanded as I want but for some reason it still fires the ajax event to load child records for each of those root level nodes.

    Sample code: This is how I'm building root level data
     var rootNodes = new NodeCollection();
     foreach (var item in lineList)
        {
    	var treeNode = new Node();
    	treeNode.NodeID = item.ID.ToString();
    	treeNode.Leaf = false;
    	treeNode.Text = item.Description;
    	treeNode.Expanded = true;
    	
    	treeNode.CustomAttributes.Add(new ConfigItem { Name = "TypeID", Value = "Line" });	
            //Adding children for root level nodes to avoid firing ajax for each node
            // Here childNodes are another node collection 
    	treeNode.Children.AddRange(childNodes);[/B]
    	rootNodes .Add(treeNode);
         }
    Can you tell me how to avoid firing ajax since data is already loaded?

    Thanks
    Last edited by Fahd; Apr 25, 2018 at 7:03 PM.
  4. #4
    Hello @Fahd!

    It would depend on how you are setting up the loader for the store of the tree grid. You should probably mark the store records as loaded so that, when the expand event fires, it finds out the data is properly loaded (as it would when you expand a node a second time.

    To be exact about how to handle it, I would step thru the expand event of the node and check when it does or does not trigger the ajax call to pull the data off the server.

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert
  5. #5
    Yes..but does Ext.Net has built in solution for marking those record as loaded or it's something I have to manually implement ?
  6. #6
    Hello @fahd!

    Sorry, I have some thoughts about this but I am just hesitating to post, because I don't really know how you are doing that and what exactly you need to achieve.

    If we could talk over an actual test case, actual code, I could for sure state there's no way to do this without some changes, suggest what to do, or point how you could benefit from Ext.NET's builtin features to dynamically load just the nodes you need.

    So, for what I know so far, I can't say Ext.NET supports or not avoiding the double load, natively.
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. [CLOSED] TreeGrid submit dirty rows
    By IMehl in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Dec 09, 2014, 9:47 AM
  2. Replies: 0
    Last Post: Mar 06, 2014, 5:41 AM
  3. Replies: 1
    Last Post: Jan 17, 2014, 3:43 PM
  4. Grouping total rows
    By emon in forum 1.x Help
    Replies: 0
    Last Post: Mar 10, 2011, 4:24 AM
  5. [CLOSED] [1.0] GridPanel summary rows without grouping
    By danielg in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Feb 16, 2010, 7:36 AM

Tags for this Thread

Posting Permissions