Custom number of displayed rows
Custom number of displayed rows
Hi All,
Maybe I missed something exploring this forum, but hope you will help me.
Basically I want to allow users to show all rows in the table at once. Do datatables support feature like this?
No matter if this will be done by choosing value from select or all rows will be displayed 'at once'.
I've tried to change iDisplayLength to custom value but after that the max (100) was displayed
I am also curious about sentence in doc "If feature enabled (bLengthChange) then the end user will be able to over-ride this to a custom setting using a pop-up menu." I have this feature enbaled but no pop-up menu displays.
Can't wait to hear you!
Anyway the plugin is great! Thanks!
Maybe I missed something exploring this forum, but hope you will help me.
Basically I want to allow users to show all rows in the table at once. Do datatables support feature like this?
No matter if this will be done by choosing value from select or all rows will be displayed 'at once'.
I've tried to change iDisplayLength to custom value but after that the max (100) was displayed
I am also curious about sentence in doc "If feature enabled (bLengthChange) then the end user will be able to over-ride this to a custom setting using a pop-up menu." I have this feature enbaled but no pop-up menu displays.
Can't wait to hear you!
Anyway the plugin is great! Thanks!
This discussion has been closed.
Replies
open the dataTables javascript and locate the function: _fnFeatureHtmlLength you will see some html creating a select list add/ammend as required!
It would be nice if we could get this configurable in some way...
This is indeed a configurable option in DataTables! You can do this through the oLanguage.sLengthMenu ( http://datatables.net/usage#oLanguage.sLengthMenu ) option. As you can see in the default there is a '_MENU_' holder - which DataTables replaces with it's built-in option menu. You can replace this with whatever select menu you want, with as many values as you want :-)
Even better - you can have DataTables display all rows by setting the value of the "All" option to -1 (from 1.5 beta 6). So All would do the trick.
Hope this helps,
Allan
Using sLengthMenu works fine! The only think to remember is if you use transalations tou should change _MENU_ in transalation files your app support.
The trick with '-1' works as well,
Thank for response and great tool!
LD