I have project in ABP, Im using entity framework 6.0, AngularJS in ASP.net MVC 4.0 I want try use pagination in grid. Im using telerik control in Kendo UI. I have some basic code but I have no idea how to start , I want to have nice paginned site, but i can't do that.
Here is my grid (list.cshtml):
<div kendo-grid k-data-source="vm.users" k-selectable="'row'"
k-pageable='{ "refresh": true, "pageSizes": true }'
k-on-change="vm.handleChange(kendoEvent)"
k-columns='[
{ "field": "id", "title": "Id"},
{ "field": "number", "title": "Numer"},
{ "field": "userName", "title": "Nazwa"},
{ "field": "nip", "title": "NIP"},
{ "field": "regon", "title": "Regon"},
{ "template": "<button class=\"k-button\" ng-click=\"vm.removeUser(#=id#)\">Usuń</button>", "title": "Delete" }
]'>
</div>
How use pagination in this grid, next to get this data from page without losing number of pages?
Here is my module in AngularJS:
(function () {
var app = angular.module('app');
var controllerId = 'app.views.user.list';
app.controller(controllerId, [
'$scope', '$location', 'abp.services.app.user', 'abp.services.app.message', 'abp.services.app.terms',
function ($scope, $location, userService, messageService, termsService) {
var vm = this;
vm.users = new kendo.data.ObservableArray([]);
userService.getUsers({ PageSize: 20 }).success(function (data) {
vm.users = new kendo.data.ObservableArray(data.items);
});
}
]);
})();
And in C# my repo:
public GetUserOutput GetUser(GetUserInput input)
{
var user = new GetUserOutput();
if (input.Id.HasValue && input.Id.Value > 0)
{
user.output = Mapper.Map<UserDto>(_userRepository.Get((int)input.Id));
}
return user;
}
What should I add?