Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82245

.row("#Id").data(row) on filtered lines breaks the row selector with hash (row("#" + Id))

$
0
0

Hi,

I use a datatable with 10000 lines (clientside).
In order to have a good responsiveness, some lines are hidden using the $.fn.dataTableExt.afnFiltering method, and these line are shown per request.
It means that the html does not reflect the internal table (filtered lines are not in the DOM).
In order to access my data, I use the table.dataTable.row("#" + lineId) functionnality (I declared the rowId on my rows).

My problem is :
When I change the values of lines that are not shown in html (not in the DOM at all) like this :

var line = this.table.dataTable.row("#" + IdOld);
line.Id = IdNew;
this.table.dataTable.row("#" + IdOld).data(line);

If I want to access by the new Id like this :

var newLine = this.table.dataTable.row("#" + IdNew);

=> the result is undefined ! It looks like it is still internally linked to the old Id (this.table.dataTable.row("#" + IdOld);)

The strange thing is that if I access the row by the index, the data has been changed by new values, which is good. Only the row selector with hash is not working.

As I think the access to the row using the hash+Id is the easiest way to access my data, do you have a solution or a different way to make it work ?

.draw() or invalidate() are not working as they are linked to DOM.

Regards,

JG


Viewing all articles
Browse latest Browse all 82245

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>