Closed bielmenezes closed 9 years ago
I believe you can set the current page directly in code, I think it is stored in gridOptions, but you'd need to check the pagination code. grid.options.paginationCurrentPage
and https://github.com/angular-ui/ng-grid/blob/master/src/features/pagination/js/pagination.js, also http://ui-grid.info/docs/#/api/ui.grid.pagination.api:GridOptions
Hello @PaulL1 ,
In fact, I can set the page number directly in code as you have shown, but if I do it in that way, it seems that the paginationCurrentPage is dispatching the event 'paginationChanged', what is not the correct behavior in my point of view. What I need is just 'inform' the paginator the number of the current page, nothing else.
Regards.
Solution provided that should resolve the issue. This does fire an additional event, but that event could be ignored by the user through using a debounce. Closing.
Plunker would be helpful.
Set the 'current-page' value equal to offset value in the function of the main search button. E.g. current-page="currentResultsPage" $scope.search = (offset = 1, searchValue){ $scope.currentResultsPage = offset; }
Hello guys,
I am using UI-GRID with external pagination and a external search form that have some filters that I can apply in the data (on server side)
My issue is when I execute the first time the search, change the page in the grid pagination component to page 2, and execute the search again via form submit's button. The page number on pagination component is not reseted to 1 (keep as page 2).
How can I handle this situation? There is any way to set the page number via API without recall my search method on server (like the seek() method does)?