How to remove pagination and show all items at runtime
How to remove pagination and show all items at runtime
I initialize my dataTable with "iDisplayLength": 5.
I wan't to show all items when a user press a button, but i can't use the built in "aLengthMenu".
I tryed to use this code to change the pagination display lenght but doesn't work:
[code]
var oTable = $('#tableDetails').dataTable();
var oSettings = oTable.fnSettings();
oSettings.iDisplayLength = 100;
oTable.fnDraw(true);
[/code]
The pagination size can't be updated at runtime? Or I need to change in other way?
I wan't to show all items when a user press a button, but i can't use the built in "aLengthMenu".
I tryed to use this code to change the pagination display lenght but doesn't work:
[code]
var oTable = $('#tableDetails').dataTable();
var oSettings = oTable.fnSettings();
oSettings.iDisplayLength = 100;
oTable.fnDraw(true);
[/code]
The pagination size can't be updated at runtime? Or I need to change in other way?
This discussion has been closed.
Replies
I'm assuming the underscore indicates this is meant to be a private member and not suitable for development as it may change. but this does work.
Maybe someone can chime in on a better or more favored solution.
http://i.imgur.com/oZiWJ.png (pic of debugger viewing the oSettings obj)
I was assuming that the oSettings had the same properties of the initial configuration, didn't notice the underscore.
It wasn't throwing javacript error, so I assumed that the name of the property was ok.