Quantcast
Channel: Free community support — DataTables forums
Viewing all articles
Browse latest Browse all 35340

wrong "indexOf" value

$
0
0

I'm apparently getting the wrong indexOf value when calling the following:

var index = table.column( 0 ).data().indexOf( 'key' );

The JSON results are returned in Descending order, so I added "order: [0, 'asc']" on the data table initiation.

When I go delete an object the index is reversed - in other words, if my data table has 10 items, I'm visually deleting the item at index 0 (first one i see) but the indexOf method returns index 9, so the bottom record is removed instead...

What can I do to properly use this IndexOf method to find/delete the right item? what if people sort/filter the table?


Viewing all articles
Browse latest Browse all 35340

Trending Articles