updating _iDisplayLength to -1 reflects on number of rows but not reflecting on dropdown

updating _iDisplayLength to -1 reflects on number of rows but not reflecting on dropdown

iyerananiyeranan Posts: 2Questions: 0Answers: 0
edited March 2014 in General
I am creating a datatable (monTable) with the following overriden options:
"bLengthChange" : true,
"aoColumnDefs" : [ {
"bVisible" : false,
"aTargets" : [ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 ]
} ]

When my table refreshes, i do the following in my callback:

var oSettings = monTable.fnSettings();
oSettings._iDisplayLength = -1;
oSettings._iDisplayStart = 1;

monTable.fnDraw(true);

It draws the table fine and shows all records, but the dropdown still shows 10 i..e the value when the table first loads. How could i change it to reflect it to All

Replies

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395
    I'm guessing you mean this:
    http://datatables.net/ref#aLengthMenu
  • iyerananiyeranan Posts: 2Questions: 0Answers: 0
    Hi Tangerine,

    I do have the menu set with the All option, but when I try to change the oSettings._iDisplayLength = -1;
    for my table in JS, it doesn't change the dropdown to reflect the changed value. However, the number of rows promptly change to showing All rows in the table

    Thanks,
    Andy.
This discussion has been closed.