using javascript hashtable as datasource
using javascript hashtable as datasource
meekaaku
Posts: 11Questions: 4Answers: 0
I have read the docs, but havnt been able to find a solution
https://datatables.net/reference/option/columns.data
i have a javascript object as a hashtable.. the data consist of
list[hashcode] = {arg : value, arg2 : value2 .... }
ie.. list is not a conventional array, but associative/hashtable like.. i dont know beforehand what hashcodes will be
how do I make datatable read from such a data structure?
-meekaaku
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
You don't - sorry. DataTables will accept only an array of data at the moment, where each element in the array is a row for the table. It will not read from objects.
You would need to convert your object to an array, which you can do using
$.map()
or similar.Allan
thanks