This is a migrated thread and some comments may be shown as answers.

Grid groupable = true when scrollable.endless = true

2 Answers 380 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Joseph
Top achievements
Rank 1
Joseph asked on 08 Aug 2019, 07:14 PM

I have kind of wild scenario.

We're using the grid to load large datasets, but only rending 500 rows at a time and rending additional grid rows with the scrollable.endless option.

This grid also has the groupable option enabled.

When collapsing a grouped section, as the rows are hidden, additional rows are rendered automatically.

This has a continuous effect where it'll continue to load every 500 rows until the grouping condition is met.

Hope all that made sense.

Is there a way to automatically collapse all groups (https://docs.telerik.com/kendo-ui/knowledge-base/grid-collapse-groups) but have it NOT render the rows until the group is expanded?  To further complicate things, when the group is expanded, is it possible to only render the first 500 rows and rely on the scrollable.endless option?

2 Answers, 1 is accepted

Sort by
0
Joseph
Top achievements
Rank 1
answered on 08 Aug 2019, 07:18 PM

This post is kind of related to my issue, but we're not using paging...

https://www.telerik.com/forums/grid-rows-collapsed-on-grouping-

0
Accepted
Alex Hajigeorgieva
Telerik team
answered on 12 Aug 2019, 10:37 AM
Hi, Joseph,

I have already responded to you in the private thread that you have submitted but I will paste my response here as well in case anyone else would like to join you in supporting the feature request to lazy load the groups and render their rows only when they are expanded, i.e. have the groups behave in the same way the detailTemplate does.

--------------------------------

Unfortunately, the desired behaviour is not achievable with the Kendo UI Grids with endless scrolling and grouping at the moment. We have a feature request logged for it and I have added a vote on your behalf here:

https://feedback.telerik.com/kendo-jquery-ui/1360438-grid-groups-start-collapsed-and-only-load-rows-when-group-header-is-opened

Programmatically collapsing the group rows with endless scrolling with the current implementation will not achieve the desired effect and could cause performance issues. When the groups are collapsed, the Grid will make requests for the data of the other groups and all of the records will be requested (especially if the group items could fit in the Grid's view).

One idea for achieving such load-on-demand approach for the groups might be to bind the Grid to a collection with the group items only (one record per unique value of the group field). Once you bind the Grid to such collection, you could then define "detailTemplate" which could make a request that will return only the records matching the value from the parent row (the group field value):

I created a sample for what the structure would look like just to demonstrate what I mean, however, I want to stress that this is just to show the structure. I am not suggesting that this is the way to do it (server grouping would be better), however, it could work in some cases if ungrouping is not desired:

https://dojo.telerik.com/atAtACaZ/3


Regards,
Alex Hajigeorgieva
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Joseph
Top achievements
Rank 1
Answers by
Joseph
Top achievements
Rank 1
Alex Hajigeorgieva
Telerik team
Share this question
or