Quantcast
Channel: Free community support — DataTables forums
Viewing all articles
Browse latest Browse all 35380

Use of column.name instead of index does not seem to work

$
0
0

I have set up names in my columnDefs as suggested:


"columnDefs": [ { "name": 'group', "targets": [ 0 ] }, { "name": 'user', "targets": [ 1 ] }, { "name": 'comment', "targets": [ 2 ] },

I now want to use these instead of column indices to make
code more readable (which I thought was the purpose of the feature):


var api = oTable.api() api.rows().eq(0).each( function( idx ) { var row_data = api.row( idx ).data()

At this point however, data.group, data.user and data.comment are all undefined,
while data[0], data[1], data[2] are populated.

Have I missed something?


Viewing all articles
Browse latest Browse all 35380

Trending Articles