Open josoroma-zz opened 7 years ago
Here you are:
Extend default query with params from url angular.extend(vm.query, $location.search());
and change url after query change $location.path($location.path()).search(vm.query);
Kybarg, thanks for your response, can you please provide more details. If for example I have control which allows me to change displayed columns, how can I save this settings?
Also Extend default query with params from url angular.extend(vm.query, $location.search()); and change url after query change $location.path($location.path()).search(vm.query);
This should be done in controller?
@zhenya2224 Yes, you need to adjust your controller. Look at example here https://github.com/daniel-nagy/md-data-table/blob/gh-pages/scripts/nutritionController.js
It will be $scope.query
in that particular case btw. And $location.path($location.path()).search($scope.query);
should be executed after getting data.
Kybarg, thanks again for your response, I will try this tomorrow. And one more thing, if I want to save the sorting setting (for example I click on the table header column - sort by name) and I want to keep that sorting setting when I leave the page, also $scope.query logic applies?
@zhenya2224 sure. It set $scope.query
params by default.
Kybarg, many thanks, its working)
Hi Hackers!
Is there a built-in mechanism to save the state of the grid we are working on and then at a later time when we come back to that page the state would be the same?
If not, is cookies or localStorage the recommended way to go?
Thanks in advance fellas!