I am trying to implement pagination in my TreeGrid. Here is relevant code:
<div style="height:900px">
<table id="tg" easyui-treegrid ng-model="data" fit="true"
data-options="
idField: 'id',
treeField: 'name',
rownumbers: true,
pagination: true,
pageNumber: 1,
pageSize:30
">
</table>
</div>
and my controller:
alarms.directive('easyuiTreegrid', function () {
return {
restrict: 'AE',
require: 'ngModel',
link: function (scope, elem, attrs, ngModel) {
$(elem).treegrid();
$(elem).datagrid({
columns: [[
{ field: 'name', title: 'Name' },
{ field: 'category', title: 'category' },
{ field: 'eventlatest', title: 'Event Latest', formatter: scope.formatDate }
]]
});
ngModel.$render = function (value) {
$(elem).treegrid('loadData', ngModel.$viewValue);
}
}
}
});
I get a pager control on the bottom that shows 30 for a page size and Page 1 of 4 which is correct because I have 93 rows. But when I click on Next button nothing happens.
Also I have a vertical scroll bar which shouldn't be there since I have pages.
Please, help. Thanks