data() returning different things
data() returning different things
![[Deleted User]](https://secure.gravatar.com/avatar/4c47de9c53ecf75e8af6de06b2d3f612/?default=https%3A%2F%2Fvanillicon.com%2F4c47de9c53ecf75e8af6de06b2d3f612_200.png&rating=g&size=120)
I have instantiated two DataTables "NewWorklistTable" and "ChooseWorklistTemplateTable" latter has one row of data.
Data is javascript sourced, element where they are instantiated are just empty table elements.
However when I try to get the data with "$("NewWorklist").DataTable().data();" it returns the datatables object.
Except when running that from chromes developer console.
In chrome console "console.log($("NewWorklist").DataTable().data());" also returns DataTables object from that element.
This behaviour happens with both datatables, first I thought something was wrong with NewWorklistTable but it
doesnt seem so. rows().data() behaves same way.
Am I doing something wrong or what could be the cause? I'm trying to get the data out the tables.
This question has an accepted answers - jump to answer
Answers
The
data()
method returns a DataTables API instance. UsetoArray()
to convert it to be just a plain array.Allan
Thank you!