DataTable column values
Briefly

DataTable column values
"rowCallback: function(row, data) { $('td:eq(0)', row).html(' ' + data[1] + ' '); },` I was using + data[0] + and + data[1] + to get data table columns returned data without "columns": [ { "data": "info1" }, { "data": "info2" } ], but when i defined "columns": in my data table jQuery + data[0] + and + data[1] + nolonger work "columns": [ { "data": "info1" }, { "data": "info2" } ], So my question is how to ac..."
""columns": [ { "data": "info1" }, { "data": "info2" } ] ,"
When DataTables is fed row data without a columns definition, the row data can be an array and numeric indices (data[0], data[1]) access fields. When the columns option is defined with data property names, DataTables maps each row to an object and the rowCallback data parameter contains properties like info1 and info2. Numeric indices no longer work in that case. Solutions include using property accessors (data.info1 or data['info1']) inside rowCallback, setting columns.data to functions or null, using columns.render to format cell output, or transforming incoming data into arrays.
[
|
]