Datatables 1.10 - remove raw issue ?

Datatables 1.10 - remove raw issue ?

AleksAleks Posts: 8Questions: 0Answers: 0
edited February 2014 in General
Hello,

I'm currently trying to remove a row based on an Index. I have a very strange behavior where the row is correctly remove from the array (the source) but not from the html table.
Here is a fiddle : http://jsfiddle.net/JnHCU/4/

Try to remove "0" for sample.

If, in javascript code, you remove all row except 5 first, it will work.
I think that there is a problem with ordering or something like that.

Any idea ?

Thank you.
- Aleks

Replies

  • AleksAleks Posts: 8Questions: 0Answers: 0
    I'm having the same problem with invalidate() now.
    And here is informations that can help finding a solution.

    Context :
    - table with 3 rows
    - I change a value in the last row (index 2) and want to invalidate it
    - MyDataTable.column(0).data().indexOf(MyID) return 2
    - MyDataTable.row(2).invalidate() do not refresh the (correct) row
    - MyDataTable.row() return :
    0: 1
    1: 2
    2: 0

    If I invalidate the row 0 (MyDataTable.row(0).invalidate()), the update is OK.

    Can I get some help ?
    Thank you.
    - Aleks
  • AleksAleks Posts: 8Questions: 0Answers: 0
    OK I just found a workaround :

    [code]
    var rowIdx = MyDataTable.column(0).data().indexOf(myID);

    // Workaround to get the correct index
    rowIdx = MyDataTable.row()[0][rowIdx];

    MyDataTable.row(rowIdx).whatYouWant(remove, invalidate, etc.)
    [/code]
This discussion has been closed.