Editor: get full data in rowCallback?
Editor: get full data in rowCallback?
Is there a way to get all data from a row in the rowCallback function of the Editor?
The data for my table is retrieved using Ajax, which gives me more columns than I need to display visually. That extra data is available for the normal DataTables columnDefs render function, so I can use that data to perform specific logic in the renderer, provided through the row parameter in
render: function(data, type, row, meta) {
// logic with row.undisplayedColumn etc..
}
However when using the Editor's rowCallback, only data that is visually rendered is available to that function through the data parameter:
rowCallback = function(row, data, displayNum, displayIndex, dataIndex) {
// data.undisplayedColumn not available here
}
If it's not easily available, would it be an idea to make it available?
Answers
This is from the Datatables
rowCallabackdocs regarding thedataparameter:I built a simple test case to show that properties not displayed in the table are accessible via the
dataparameter:https://live.datatables.net/zipaxiwe/1/edit
Please update the test case or provide a link to a test case replicating the issue.
Kevin
I've been fiddling to get a working version of my situation and while doing that I found out what was wrong on my end. My backend is delivering a column in the row data only when there's a value. With a null-value it's being omitted. The first few rows didn't contain that column data, so I assumed not all row data was returned in the rowCallback.
My bad!
Great to hear you've found the issue - nice one tracking it down. Sometimes it is the little things that trip us all up!
Allan