Accessing row data from Nested DataTable
Accessing row data from Nested DataTable
menashe
Posts: 198Questions: 44Answers: 2
When dealing with "regular" DataTable rows, I can access the underlying data by using the following:
pricesEditor.on('open', function(e, mode, action) {
...
priceData = pricesTable.row({
selected: true
}).data();
});
How can I access the data from a row in a Nested DataTable?
Answers
You will need to access the API of the nested table, ie replace
pricesTable
with the nested table API. The next question is how to access the nested Datatable API. That depends on how you are nesting the Datatables. Are these in Child Detail Rows or something else. Maybe you can post the relevant code showing your nested Datatable soluition.Kevin
If you are using a
datatable
field type, it has adt()
method to get the DataTable API instance - e.g.:Allan
Hi Allan,
I thought that
editor.field
takes a field name?I have not been able to get it to work. I am using a
datatable
field type, but I am not sure what field name to use!It does. I just used
myTable
as a placeholder. In this example it would be'users.site'
.Perhaps you can show me your full code, or give me a link to a page showing the issue?
Allan