jQuery Datatables server side pagination with Restangular
jQuery Datatables server side pagination with Restangular
How can I use server side pagination with Restangular? When I enable "withOption('serverSide', true)", Datatables will call the API twice: A regular call and a datatables call passing datatables values but without the route "api/clientes".
https://s31.postimg.org/xz3v7q9bf/datatables.jpg
I'm trying this code but with no success. How can I solve this?
var getTableData = function () {
var defer = $q.defer();
RestangularAuth.all('clientes').getList().then(function (result) {
defer.resolve(result.data);
});
return defer.promise;
};
vm.dtOptions = DTOptionsBuilder.fromFnPromise(getTableData())
//.withOption('serverSide', true)
.withPaginationType('full_numbers');
Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
This question has an accepted answers - jump to answer
Answers
I'm afraid I've never actually heard of Restangular before so, as far as I am aware, there isn't an existing server-side processing implementation for it. The details you will need in order to create one are in the manual and if you do, I'm sure others would appreciate if you were to post your solution.
Allan