How to reset iDisplayLength from Javascript?

How to reset iDisplayLength from Javascript?

fogcityfogcity Posts: 7Questions: 0Answers: 0
edited September 2010 in General
I'm using DataTables for an iPad web app, and when the screen orientation changes (ie when user tilts the device) i need to redraw my table the exact set of rows that fits onscreen.

I'm assuming that I don't have to destroy the DataTables object and restart with a new iDisplayLength value?

Have perused the documentation but it's not clear on this point. In any case, what is the recommended method for updating the number of rows in the table, from Javascript?

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Hi fogcity,

    Sounds interesting! Would you be able to give us a link to your app when you are done (curiosity :-) )?

    What you can do to change the display length is make use of this plug-in: http://datatables.net/plug-ins/api#fnLengthChange . Then there is an API function available which you can call with whatever number you want.

    Allan
This discussion has been closed.