Retrieving hidden data element for each visible row
Retrieving hidden data element for each visible row
LesF
Posts: 16Questions: 6Answers: 1
I have an internal id in the row data, assigned to a hidden column, and I need to collect a list of these ids, for the current page.
I can't get it via jQuery because the hidden column is not rendered in HTML, so I need to get the data array for each row.
I can't work it out from the API docs, has anybody done something similar?
This discussion has been closed.
Answers
https://datatables.net/reference/api/column() and provide the class you gave the associated th.
I have a partial solution but need to refine this to retrieve just the data related to the current displayed page. This gets me all elements from the data array that the table is populated from, where rowData[0] is a hidden value not present on the table:
I am trying to work out how to get the same information for just the current page, and this seems to be the right approach but I cannot work out what object type the data() property is giving me here:
Basically I want a reference to the underlying data array for each row displayed, in the current sort-order.
Ok found it. Still getting my head around the power of this tool The DataTables.Api is right there...
I believe this is the most concise way to get what I need.
Can you please use DataTables Live so we can see a working example of the functionality you are trying to achieve.
No need as I solved my problem. My last post shows the solution, but I can't mark my own reply as the correct answer.