Selected row column data by columns.name
Selected row column data by columns.name
Hi,
I am trying to retrieve the value of a specific cell from a selected row. I want to use the columns.name to get the value. I can get the value like this:
....on( 'click', 'tr', function () {
alert( divMyDataTable.row( this ).data()[1] );
}
I would like to do something like this instead:
....on( 'click', 'tr', function () {
alert( divMyDataTable.row( this ).column( 'MyID:name' ).data() );
}
If this is possible, what is the proper syntax?
When building the table, I have defined the columns.names and I can use them for other purposes as described in the documentation here: https://datatables.net/reference/option/columns.name successfully.
Answers
You can use a callback as a
column-selector
When i get home, ill writeup a demo