jQuery DataTables Pagination Size

Sam picture Sam · Nov 8, 2011 · Viewed 89.7k times · Source

i've been using jQuery DataTables plugin ( http://datatables.net ) for quite some time and usually we're super fine using the default sizes and using "bStateSave": true option.

But now i really need to set the sizing of the pagination not as [10,25,50,100] but rather i need this as let's say [1,2,3]. I get the menu to set like this with setting the option aLengthMenu:[1,2,3] and if i select one of the options it sets the correct selection amount.

But on dataTable STARTUP it doesn't set the length to 1,2,3 but rather to the default '10'

Which option am i missing? Thanks in advance!

Answer

max4ever picture max4ever · Nov 8, 2011

clear your cookies, the ones datatables saved when you were using bStateSave and you had 10,25,50,100

then refresh and it should now save 1 or 2 or 3

do you mean

"aLengthMenu": [[5, 10, 15, 25, 50, 100 , -1], [5, 10, 15, 25, 50, 100, "All"]],
"iDisplayLength" : 10,