BlazorTable
BlazorTable copied to clipboard
[Feat] Layout changes should trigger an event
When a layout change happens (e.g. column reorder, column shown/hidden), an event should fire.
Use case: I want to be able to save and restore the layout the user has selected for the table. If they hide a column, I want it to be hidden the next time they visit that page.
Ideally, we want an event that fires whenever the layout changes. This would send some kind of object with a representation of the current state of the table, versus how the table was initialized.
We would also need a callback that fires when the table loads, which would allow this object to be passed in to the table, which would restore this saved layout.
As an example, the DevExpress grid supports this via LayoutChanged and LayoutRestoring events. It uses an IDataGridLayout object which seems to contain a list of shown columns, column order, etc. When LayoutChanged fires, it gives us this object. (I save this object to local storage as a user preference) When the control loads, it can take this object and apply that layout back to the grid. The result is a seamless saving of the display state of the grid for the user from session to session.