I'm trying to figure out how to persist and restore state in the native Vue grid. Am I missing something; is this not available yet?
I found the article about doing it with the grid wrappers, but not native.
Thanks!
6 comments
ADMIN
Petar
Posted on:11 Oct 2022 15:36
Hello, everyone.
I am writing to share that there is already a separate demo about the Native Grid's State Persistence that can be found on this link to our documentation.
Regards,
Petar
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
ADMIN
Plamen
Posted on:06 Sep 2021 04:44
Hello,
Yes indeed this is the correct way to save the columns state. Thank you for sharing you solution with the community.
Regards,
Plamen
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
John Campion
Posted on:04 Sep 2021 14:26
For anyone else finding this, yes, you can also save and restore the columns this way too.
Thanks! This is helpful; is there similar login for storing column order and size?
ADMIN
Petar
Posted on:31 Aug 2021 15:29
Hi John,
The state management in the Vue and thus the Native Vue Grid depends on the values of the properties that are used in a given scenario.
What I want to say with the above is that to reload the Native Grid to a pre-saved state we just need to pass it the values of the different props that have been used at the moment of saving.
Here is a StackBlitz example demonstrating how we can Save and Reload the state and configuration of the Native Grid component. To save Grid's state in the example, the following method is used:
A key thing with the state and configuration reload is to call the marked in yellow updateState method that refreshes the Grid and is defined as follows:
Using the above approach, we can save the values of all Grid properties and not only these listed above.
Another approach you can use is to store Grid's state using Vuex, instead of using the localStorage of your browser. Check this article that discusses the usage of Vuex.
With the above example, I will mark the current Feature Request as completed. Let me know if you have additional questions related to the suggested implementation or if you need further assistance with the current thread.
Regards,
Petar
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.