fnDraw() doen't reset "sSearch" and "iDisplayLength" variables

fnDraw() doen't reset "sSearch" and "iDisplayLength" variables

diondudiondu Posts: 24Questions: 0Answers: 0
edited May 2010 in Bug reports
Hi,

I'm using AJAX and i'm trying to run oTable.fnDraw() but after the table is redrawn the table doesn't "reset" the sSearch and iDisplayLength variables. It only resets the Search and Display Length fields above the table.

The new table is loaded within the old sSearch an iDisplayLength paramters.

I tried to use oTable.fnFilter('') instead of fnDraw. It works reseting sSearch but the new table is still draw with the old iDisplayLength. For example: I load the table and then I change the "Display Length" from 10 (default) to 25. When I redraw the table the new table is drawn with 25 records even the DisplayLength Select Box show the default 10 records.

Is there a way to overcome this problem? Is this a DataTable bug?

Thanks.

Replies

  • diondudiondu Posts: 24Questions: 0Answers: 0
    Allan, can you check if this is a bug or if is there anything to do in order to overcome this problem?
  • allanallan Posts: 61,443Questions: 1Answers: 10,053 Site admin
    This is fully intended and working as it is - fnDraw redraws the table, it doesn't alter filtering, sorting or anything else, it just redraws how it is currently set up. So you know how to use fnFilter to clear the filter now, and this plug-in can be used to change the display length: http://datatables.net/plug-ins/api#fnLengthChange

    Allan
This discussion has been closed.