Selected row column data by columns.name

Selected row column data by columns.name

nathanabourbihnathanabourbih Posts: 1Questions: 1Answers: 0

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

This discussion has been closed.