$(table).DataTable().data() is an empty object
$(table).DataTable().data() is an empty object
sagimann
Posts: 18Questions: 9Answers: 0
Hi all,
I have a table with 1 visible row, working well.
At some point I want to run some script to access the table's data, so I call:
var rows = $(table).DataTable().data()
console.log(rows)
this outputs:
Object {}
Here is how the table is initialized:
$(table).dataTable( {
"sDom": "Tfrtip",
"aaData": [
{
"name": "xxx",
"link": "yyyy"
}
],
});
any idea why data() is empty? According to the example, it should contain 1 row in my case.
tnx
This discussion has been closed.
Answers
found the reason:
while I was working with DT, the website has changed, with docs now pointing to 1.10 instead of 1.9.... so I was trying to use 1.10 API on top of 1.9... I switched to 1.10 and now it works...
Nice one. For reference, if you want the old 1.9 documentation, it is available at legacy.datatables.net.
Allan