Data of selecting row
Data of selecting row
in DataTables
I feel like this is redundant. Can i find the data of the row withou calling the inner function?
tabellePlan.on( 'select', function () {
tabellePlan.rows({selected: true}).data()
} );
This question has accepted answers - jump to:
This discussion has been closed.
Answers
Its not redundant. Line 1 is the
selectevent handler. In the handler that executes when a row is selected. Line 2 uses therows().data()API. Theselector-modifierof{selected: true}filters the rows returned from therows()API to those that are selected. You can usetabellePlan.rows({selected: true}).data()at anytime, it doesn't need to be within theselectevent.Does this address your concern?
Kevin
As Kevin said, but it's also worth noting that
selectpassed the indexes of the selected items into your function, so you can do something like this;Colin