Using Length Menu
Using Length Menu
yishayh
Posts: 108Questions: 17Answers: 0
Hi Alan,
when using the length lengthMenu option:
tableOptions.lengthMenu = [
[10,20,50,100,200,400],
[10,20,50,100,200,400]
];
We used settings._iDisplayLength to get the selected length, and it worked most of the time, but there are cases where it doesn't work, are we using the wrong attribute?
Many thanks,
Yishay
This discussion has been closed.
Answers
The settings object should never be used. It is considered to be private. Its parameters can, will and do change between versions.
Use
page.len()
to get the page length.Allan
Hi Allan,
thanks as usual for these quick replies.
We changed it to page.len(), but we still have a problem, because it returns the number of records in the table and not the selected param from the the lengthMenu menu (We have some filter capabilities that are operated outside the table itself).
How can we get only the selected length from the lengthMenu without taking into account the length number of records actually in the table?
Many thanks,
Yishay
That's exactly what
page.len()
should do. If it isn't I'd need a link to a page showing the issue please.Allan
Hi Allan,
it is in our private environment, I'll write you in private the details.
Many thanks,
Yishay