There is a problem when using Grid's row detail and group at the same time

1 Answer 48 Views
Grid
Steve
Top achievements
Rank 1
Iron
Iron
Steve asked on 18 Dec 2023, 02:00 PM

Hi, there are three issue in my demo, please check. and if you find any message please give me replay, Thank a lot.

1. All rows become expanded by default.
2. Click the minus sign. The row detail data is not updated.

3. Group-level expansion does not work properly

cool-field-mpzjjj - CodeSandbox

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 20 Dec 2023, 12:32 PM

Hi Steve,

The issue that you are facing is due to the fact that when the onExpandChange event fires for the detail row, you are mapping "result.data", which at this point contains a collection of the group items and not the data items. If you replace "result.data" with "products", you will notice that the expand will work. However, since the products will not contain the previous state, you will have to use a state variable that will hold a collection with the data items.

For your convenience, you can use the following example as a reference for enabling expand/collapse for groups and detail rows:

Hope this helps.

 

Regards,
Konstantin Dikov
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources!

Steve
Top achievements
Rank 1
Iron
Iron
commented on 11 Jan 2024, 02:17 PM

Thank you for your message, but I find another issue in my project. The average calculation is obviously wrong. Can you help me check where the problem is? This console is on line 85 of main. Zxqyyc (forked) - StackBlitz
Konstantin Dikov
Telerik team
commented on 11 Jan 2024, 06:51 PM

Hi Steve,

The state that you are using has "50" for the "take" and not all items are visible in the data (because this is the items collection for the first page). However, the aggregates are calculated without taking into account the paging and all items within the group are calculated. With that in mind, if you remove the "take" from the state you will notice that the aggregates are correctly calculated using all items within the group.

Tags
Grid
Asked by
Steve
Top achievements
Rank 1
Iron
Iron
Answers by
Konstantin Dikov
Telerik team
Share this question
or