Hi
I want a small clarification on one of the functionality related to IgrDataGrid (https://www.infragistics.com/products/ignite-ui-react/react/components/grids/data-grid/overview).
I am trying to use the functionality of saveLayout and loadLayout with my grid but whenever the page is refreshed or the application is restarted the saved layout didn't load.
So, is there any way to save the layout of the grid in the File System so that it can be accessed anytime whenever needed and if not then please suggest some alternate solution as I need to implement this in my IgrDataGrid.
Hoping for a positive response.
Thanks!!!
Hello Avanish,
I believe you are talking about this save/load layout sample :https://www.infragistics.com/products/ignite-ui-react/react/components/grids/data-grid/load-save-layout
When ever page refresh ,page will reload and loss the save layout is expected ,because if you notice in the sample layput is been saved in the string , you can use you local storage or sever to save the layout.
Thankyou for your kind response.
I am not getting how to use local storage or sever to save the layout. If you can please provide me some sample of example code then it would be great.
Hello Avinash,
In the sample you see we are saving layout in public savedLayout: string;,
rather use local storage like explain in this post to save layout.
https://www.robinwieruch.de/local-storage-react/#local-storage-in-react
We dont have any sample yet to demonstrate this but you can find lots of online sample explaining how to use local storage to save string in react.
Regards.