Reputation: 1550
I'm using AngularJS datatable and enable save state with .withOption('stateSave', true)
.
when I refresh the page, everything works fine But when I change routes, and came back, stateSave
not working.
I found that, At each route change, datatable create a localStorage
to save current table state with difference key
! so when change route, saveState not working.
How can I solve the problem?
Upvotes: 2
Views: 472
Reputation: 865
Add an attribute id into the table. And add the following code into your angularjs controller
$scope.vm.dtOptions = DTOptionsBuilder.newOptions()
.withOption('stateSave', true);
Upvotes: 1
Reputation: 1034
Just add an id
attribute to the <table>
element, like <table id="xxx" datatable>
.
Upvotes: 0