0
votes

We currently use the Kendo grid, and make extensive use of its ability to persist and load state, ie. we allow our Users to be able to customize their grid layouts, for columns, sort order, grouping, etc. and then "Save" the layout in a named collection that they can later re-apply. This is the Kendo feature I am speaking of: Kendo Grid Persist State

Does ag-grid already have a built-in feature to do the same, or does anyone have a sample they can share where they have done the same sort of thing? Looking at the ag-grid documentation, it looks like it would be a fairly straight-forward thing to code, but I was hoping to find examples and/or advice and guidance on any pitfalls to avoid, etc. Thank you.

2

2 Answers

4
votes

We use ag-Grid together with the Adaptable Blotter and we are able to save not only views as you request, but also searches, reports, style rules, alerts, charts etc. I am not sure whether that is ag-Grid or Adaptable Blotter which is responsible but it works really well.

-1
votes

ag-grid does support getting and setting the current column state. Looking at the sample from kendo grid, this should accomplish the same:

//getting
var columnState = gridOptions.columnApi.getColumnState();
localStorage["ag-grid-state"] = JSON.stringify(columnState);

//setting
var columnState = localStorage["ag-grid-state"];
gridOptions.columnApi.getColumnState(JSON.parse(columnState));