fnDraw not working as expected with jsArray data source
fnDraw not working as expected with jsArray data source
Go to this example page, http://datatables.net/release-datatables/examples/data_sources/js_array.html , and edit the contents of a cell using the browsers inspector tool. Enter something random like 'test123'.
Now in the browsers console execute fnDraw on the table: $("#example").dataTable().fnDraw();
I would have expected 'test123' to be replaced by the original value that is still stored in the jsArray but this did not happen. Why and how can I get the table to reset/update based on the original data in the jsArray.
Thanks.
Now in the browsers console execute fnDraw on the table: $("#example").dataTable().fnDraw();
I would have expected 'test123' to be replaced by the original value that is still stored in the jsArray but this did not happen. Why and how can I get the table to reset/update based on the original data in the jsArray.
Thanks.
This discussion has been closed.
Replies
Allan
[code]
var table = $("#example").dataTable();
var data = table.fnGetData();
for(var i = 0; i < data.length; i++){
table.fnUpdate(data[i],i);
}
[/code]
but when I do this on my own dataTable I get an error:
[quote]
DataTables warning (table id = 'jJOqvjLtGuPhjA5fUvaNfA_3D_3D'): Requested unknown parameter '0' from the data source for row 0
[/quote]
And console says maximum call stack exceeded.
Any ideas? I'm stumped.