Length Menu outside datatable
Length Menu outside datatable
haonoy
Posts: 5Questions: 2Answers: 0
I have Select option and I need Length Menu link my select option.
This discussion has been closed.
Answers
Use
page.len()
to set the page length using the API.Allan
var oTable = $("example").DataTable();
oTable.page.len(50).draw(); //not working
Works for me: http://live.datatables.net/nopatod/1/edit . Please link to a test case, showing the issue.
Allan
I using
var oSettings = oTable.fnSettings();
oSettings._iDisplayLength = parseInt($('#lengthChange').val());
oTable.fnPageChange("first");
It's work.
-Thanks-
Fair enough, although you are modifying internal values there which I would very strongly recommend against. I guess you are using an old version of DataTables?
Allan
I using 1.10.0 version of DataTables
In which case I would suggest you use the
page()
API method. Don't use private methods, there is no telling what will happen.Failing that, please provide a test case as requested.
Allan