I have Select option and I need Length Menu link my select option.
Use page.len() to set the page length using the API.
page.len()
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.
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?
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.
page()
Failing that, please provide a test case as requested.
It looks like you're new here. If you want to get involved, click one of these buttons!
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