Unplanned
Last Updated: 12 Aug 2019 10:23 by ADMIN
Emily
Created on: 20 Jul 2018 19:27
Category: Grid
Type: Feature Request
5
Grid - groups start collapsed and only load rows when group header is opened
For performance reasons, we would like to only show the group headers collapsed when first grouping, and only add its child rows when expanded. This is done for hierarchical grids and minimizes unnecessarily large DOMs for data the user will never look at. 
1 comment
Emily
Posted on: 20 Aug 2018 23:30
This suggestion doesn't include any changes to the current data source implementation for grouping. If in _groupRowHtml, the creation of the headers and footers stay the same, but  the call to _rowsHtml was removed or optional. This means that when rendering the group rows, the headers and footers are added to the html (including all subgroup headers and footers). The only difference from before is the actual row data isn't added to the html. The group data source is still created as normal. Then, on the groupExpand event, you can call _rowsHtml(e.group.items, templates) to get the html for that section (just like you would have in _groupRowHtml) then insert it after the grouped row with e.element.after(htmlRows). This would simplify the DOM, and shouldn't have any other consequences since the data source hasn't changed or been impacted.