angularjs-table
angularjs-table copied to clipboard
Preserving table state
Is there a way to export current column widths and display order so that the display options can be preserved?
Yes, via the storage
option. Looking back on it I realize that I need to improve the documentation around this feature. Basically you set an object to the storage
option (on the table options object) that implements setItem
, getItem
, and removeItem
. You will also need to set the storageKey
option (this identifies the specific table instance). It's actually very easy to try it out because window.localStorage
implements these three methods. So, just add this to your table options object:
scope.yourTableOptions = {
// ... other options you might have ...
storage: $window.localStorage,
storageKey: 'myAwesomeTable'
}
I'll try to make an effort to improve documentation regarding this feature. Let me know if anything is unclear!