Update TypeError: Cannot set property '_aData' of undefined ( + jsfiddle)

Update TypeError: Cannot set property '_aData' of undefined ( + jsfiddle)

Gfn25Gfn25 Posts: 2Questions: 0Answers: 0
edited March 2013 in DataTables 1.9
Hi everyone!
I've just started using the DataTables 1.9.4, and found this issue on a (possibly) simple thing for you.
If you run this code on this page, http://jsfiddle.net/HEDvf/524/ , you will get the error shown on the subject of this page. Note that I've loaded all files needed for displaying the table along with bootstrap (as in the website example).

The init code is at the javascript frame.

Here are my questions:
1. I want to update the entire datatable, (var dtable), whith a new array of data. Why isn't this code working?
2. Since I want to replace the entire table multiple times, should I better use 'fnDestroy' so as to clear memory? Otherwise, will fnUpdate NOT leak any memory of not-needed data?

Thank you in advance! :)

Replies

  • allanallan Posts: 63,389Questions: 1Answers: 10,449 Site admin
    fnUpdate will update a single row or cell - not the whole table as you currently have. See the documentation here: http://datatables.net/api#fnUpdate . Use fnClearTable and fnAddData .

    Allan
  • Gfn25Gfn25 Posts: 2Questions: 0Answers: 0
    Thanks allan.
    Now I've set it to fnClearTable, fnDestroy, and then enable dataTables.

    There seems to be a memory leak when you place the "destroy" parameter only, the profiler shows memory consumption keeps increasing, and thus you have to do the above steps in sequence to free all un-needed memory data.

    You might as well see this yourself if you want. :)

    Thanks
This discussion has been closed.