I am currently using : "angular-smart-table": "2.1.0" "angular": "1.3.15"
When clicking on Smart table item, my application display item details in another page. After visiting the item page i want to go back on the smart table page on the same pagination number (2 on the screenshot) : Screenshot
My problems :
- Don't know how to save currentPage (rootscope, paramter ?)
Here is the pagination view, which manage pagination :
<nav ng-if="pages.length >= 2">
<ul class="pagination">
<li><a ng-click="selectPage(1)" class="download">Début</a></li>
<li><a ng-click="selectPage(currentPage - 1)" class="download"><</a></li>
<li><a><page-select></page-select> / {{numPages}}</a></li>
<li><a ng-click="selectPage(currentPage + 1)" class="download">></a></li>
<li><a ng-click="selectPage(numPages)" class="download">Fin</a></li>
</ul>
- Don't know how to call function "selectPage()" of the smartTable directive.
pageSelect Directive in 'smart-table-plugin-directive.js' :
.directive('pageSelect', function () {
return {
restrict: 'E',
template: '<input id="test" type="text" class="select-page" ng-model="inputPage" ng-change="selectPage(inputPage)">',
link: function (scope, element, attrs, $rootscope) {
scope.$watch('currentPage', function (c) {
scope.inputPage = c;
scope.$root.page = c;
});
}
}
}
Thanks for responding
Y@ugy