ColVis is producing error in DataTables core (1.9.4) with ColReorder

ColVis is producing error in DataTables core (1.9.4) with ColReorder

miwoemiwoe Posts: 14Questions: 2Answers: 0
edited July 2013 in Bug reports
If I am reordering the columns, refresh the page (bStateSave = true), click on ColVis "Show/Hide columns" popup, select a column to hide or show, then I get follwing error:

TypeError: aoLocal[i][j] is undefined
nLocalTr.appendChild( aoLocal[i][j].cell ); in jquery.datatables.js; Line 1349

Is there any workaround, I can do?

Replies

  • miwoemiwoe Posts: 14Questions: 2Answers: 0
    I have seen now that refreshing is not necessary to produce the bug. Clicking twice on the column for showing and hiding it again produces also the error if columns were reordered before.
  • miwoemiwoe Posts: 14Questions: 2Answers: 0
    Update: I have seen the error occurs only on this table. The difference between my other table is that this table has three rows in the header. The first one with colspan="12".
  • miwoemiwoe Posts: 14Questions: 2Answers: 0
    Update & Probably the solution:

    If I change the if statement to:
    [code]if ( aApplied[i][j] === undefined && aoLocal[i][j] !== undefined )[/code]

    it seems that everything is working smoothly again, even with this setup of a header row with a colspan > 1
  • miwoemiwoe Posts: 14Questions: 2Answers: 0
    Would be nice to know if the fix could be introduced in future patches...
This discussion has been closed.