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

Kendo Grid Grouping

3 Answers 455 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jiyo
Top achievements
Rank 2
Jiyo asked on 18 Dec 2019, 06:18 AM

I'm using kendo react grid grouping feature to group datas in grid.The problem is i'm not able to expand or collapse the group.

 

Here is my code....

https://stackblitz.com/edit/react-ryuhdv?file=index.js

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 18 Dec 2019, 08:06 AM

Hello, Jiyo,

Thank you for your example.

The issue occurs as the expandField prop is not set. This points to the field in the data which will determine if the item will be expanded or not:

https://www.telerik.com/kendo-react-ui/components/grid/api/GridProps/#toc-expandfield

This is the updated example:

https://stackblitz.com/edit/react-vjntwc?file=index.js

I hope this is helpful.

Regards,
Stefan
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Jiyo
Top achievements
Rank 2
answered on 14 Jan 2020, 12:02 PM

Hiii,

can you please take a look into the following example which uses kendo grid grouping.In this example i'm not able to expand or collapse the group.

Here is the link.........https://stackblitz.com/edit/react-vfxqxq?file=index.js

0
Stefan
Telerik team
answered on 15 Jan 2020, 08:15 AM

Hello, Jiyo,

This occurs because when updating the expanded state using the event item, this is directly updating the specific object. Then when the process method is used inside render, this is creating a new instance of the data array when the expanded value is lost.

As in the example the process method is used inside render, this means that every time a new instance is created.

event.dataItem.expanded

I updated the example to use the dataResult inside render and the expand and collapse are working. Still, after the process method is called for example after the grouping is changed the current expand and collapsed state will be lost.

I can suggest keeping the expanded items inside an additional array and applying the expanded value after any data operations.

As this is not a straight forward task, we have planned to update the process method, so it can apply the expanded state as well when processing the data.

 

Regards,

Author nickname

Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Jiyo
Top achievements
Rank 2
Answers by
Stefan
Telerik team
Jiyo
Top achievements
Rank 2
Share this question
or