Custom number of displayed rows

Custom number of displayed rows

dzidadzida Posts: 23Questions: 0Answers: 0
edited May 2009 in General
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!

Replies

  • naspinskinaspinski Posts: 13Questions: 0Answers: 0
    ALong the same lines, how can I add a 'All' to the length change dropdown? Or alternatively, if that is not possible, how about even adding a really large number like 1000? I did not see this anywhere in the documentation.
  • brianmmbrianmm Posts: 41Questions: 0Answers: 0
    edited May 2009
    Only way I found to do this was in the code.

    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...
  • naspinskinaspinski Posts: 13Questions: 0Answers: 0
    Nice, that works great. But yeah, would be nice if that was a configurable deal.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Hi guys,

    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
  • dzidadzida Posts: 23Questions: 0Answers: 0
    Hi,

    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
This discussion has been closed.