Ng-grid Server Side Paging
I'm a little confused on how to use the sever side paging for ng-grid. (http://angular-ui.github.io/ng-grid/) Can someone point me in the right direction on how to achieve this on
Solution 1:
Not sure if this helps you because I use the SLIM Framework for routing and MEEKRO as mysql famework on my serverside. But it comes down to this:
This is what my getPagedDataAsync
function looks like
$scope.getPagedDataAsync = function (pageSize, page, sorting,searching) {
$http.get('db_api.php/'+pageSize+'/'+page+'/'+sorting.sortfield+'/'+sorting.sortdir+'/'+searching).success(function (data) {
$scope.profiles = data.result;
$scope.totalServerItems = data.all;
$scope.filtered = data.filtered;
if (!$scope.$$phase) {
$scope.$apply();
}
});
};
It sends a GET request to my php script with the parameters that are gathered by the watchers. Unlike the example this takes also the sortOptions
into account. If you don't want to use a routing framework on the server side you should replace the slashes with the usual questionmark ampersand notation.
By looking at your rep I think this should already give you a clue. Come back if you need further help on the sql query.
Post a Comment for "Ng-grid Server Side Paging"