Reputation: 879
There is a project that uses angular-datatables. Now I need to remove "Show N entries" dropdown from a page with such table, but leave pagination untouched. For now i've found this way -
withOption('paging', false)
but this removes both!
Can anyone show me better way than just to remove them from DOM manually?
Upvotes: 1
Views: 7797
Reputation: 85538
Yes - paging
removes both since there is no need for showing the lengthmenu if the table not is paginated. Use the lengthChange
option to control whether the lengthmenu should be visible or not :
$scope.dtOptions = DTOptionsBuilder.newOptions()
.withOption('lengthChange', false);
demo -> http://plnkr.co/edit/0PnEwohCF9348uAf6OSD?p=preview
Upvotes: 5
Reputation: 275
You try add follow option to dtOptions:
.withLanguage({
"sInfoFiltered": ""
})
Upvotes: 0
Reputation: 35
Yes -
paging
removes both since there is no need for showing the lengthmenu if the table not is paginated. Use the [lengthChange
][1] option to control whether the lengthmenu should be visible or not :$scope.dtOptions = DTOptionsBuilder.newOptions() .withOption('lengthChange', false);
it's still there.
vm.dtOptions = DTOptionsBuilder.newOptions().withPaginationType('full_numbers')
.withDisplayLength(10)
.withOption('lengthChange', false);
Upvotes: 0