fnGetData question
fnGetData question
Maddy
Posts: 24Questions: 0Answers: 0
i have a question regarding datatables fngetdata. Im using aData = oTable.fnGetData(aPos); to fetch a row from my datatable. I'm getting the data in array format. so my 1st column data will be aData[0], 2nd will be aData[1] and so on. Can I get the data in associative array format. For example, 1st column name is Group, so can the data be aData[Group]? I need this format because, my datatable is being populated from a mysql table and whenever I expand the table to add columns, I have to change the positions of all other columns. I want to remove the positional dependency. Please advise. Thank you.
This discussion has been closed.
Replies
If you were to pass it in as an object, then yes. See: http://datatables.net/blog/Extended_data_source_options_with_DataTables .
Basically fnGetData will return to you want you give it for the data for each row, or as an array if reading from the DOM.
Allan