Change default value of iDisplayLength?

Change default value of iDisplayLength?

alhendersonalhenderson Posts: 9Questions: 0Answers: 0
edited February 2014 in General
Morning All,

I have a datatable where I initialise 'iDisplayLength' to -1 (to show all rows). When I then choose to show pages, the table then shows 9 rows. I am using sDOM to make my table a fixed min height but 9 rows does not fill this. Can I somehow change that '9' that datatables decides to use when switched to pages mode?

Thanks,
Al.

Replies

  • alhendersonalhenderson Posts: 9Questions: 0Answers: 0
    I can answer my own question :-) The value for the appropriate options in the length change drop down is used as the value for iDisplayLength when you select it. In my table, I have 2 length options - All and Pages. If the Pages option has a value of 20 then the table will show 20 rows.

    Makes perfect sense now I think about it, its only when I came to try and write my own change handler for the length change drop down that I realised this!

    Cheers,
    Al.
This discussion has been closed.