Multiple grids on a same page - controlled by independent dataState

1 Answer 63 Views
Grid
smd
Top achievements
Rank 1
Iron
smd asked on 31 Jul 2023, 05:46 PM

Hi,

Is it possible to change name "dataState" to something else? I have the question because when I have two separate Kendo React grids on the same page, I want to avoid having changes on one grid (dataState) affect the other grid as well

1 Answer, 1 is accepted

Sort by
1
Accepted
Wissam
Telerik team
answered on 01 Aug 2023, 07:35 AM

Hello,

`dataState` is a state variable and can be renamed to anything else. Basically, it stores an object that contains the values of sort, group, filter, skip, and take that are passing to the Grid by passing its spread:

{...dataState}

In addition, since you have two Grids and each has its own dataState, you should also set their onDataStateChange events to different event handlers.

I hope this helps, but please let me know if you have any further questions.

Regards,
Wissam
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!

smd
Top achievements
Rank 1
Iron
commented on 02 Aug 2023, 07:30 AM | edited

Thank you. With your reply, I looked back on my code and found where I had it wrong. I appreciate the support
Wissam
Telerik team
commented on 02 Aug 2023, 07:58 AM

You are welcome. I am glad that my reply was helpful to you.
Tags
Grid
Asked by
smd
Top achievements
Rank 1
Iron
Answers by
Wissam
Telerik team
Share this question
or