How to change the default number of records to display?

How to change the default number of records to display?

valdezrvaldezr Posts: 49Questions: 0Answers: 0
edited April 2009 in General
Wich parameter helps to change the numbers of the list to display records?

Replies

  • allanallan Posts: 61,822Questions: 1Answers: 10,127 Site admin
    Hi,

    You can specify the options in the length drop down menu through the oLanguage.sLengthMenu parameter ( http://datatables.net/usage#oLanguage.sLengthMenu ). Just stick in a select menu with the option that you want :-)

    Allan
  • valdezrvaldezr Posts: 49Questions: 0Answers: 0
    Thanks again for your quick support,

    I am afraid, it is not enough this explanation, where do I need to put the custom select and what would be their name or id? I need to set 50, 100, 500 and 1000 options.

    Thanks in advance.
  • allanallan Posts: 61,822Questions: 1Answers: 10,127 Site admin
    Hi valdezr,

    Have a look at this example for how to pass in customised language variables to DataTables: http://datatables.net/examples/example_language.html

    For sLengthMenu you could pass in "50..." (in place of _MENU_) which will do the trick for you. There is no need to assign id or classes - DataTables will do that for you. :-)

    Allan
  • valdezrvaldezr Posts: 49Questions: 0Answers: 0
    Thanks a lot, it finally works
  • sharonmsharonm Posts: 2Questions: 0Answers: 0
    Sorry I still don't understand how to do this. I'd like the default dropdown for number of items to show but have 25 as the selected instead of 10. When I try to do this with my own select menu, I lose my pagination.
  • allanallan Posts: 61,822Questions: 1Answers: 10,127 Site admin
    Use the iDisplayLength parameter to set the initial length.

    Allan
  • sharonmsharonm Posts: 2Questions: 0Answers: 0
    Aha. Thanks.
This discussion has been closed.