Data of selecting row
Data of selecting row
support@kosmos.de
Posts: 16Questions: 7Answers: 0
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:
Answers
Its not redundant. Line 1 is the
select
event handler. In the handler that executes when a row is selected. Line 2 uses therows().data()
API. Theselector-modifier
of{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 theselect
event.Does this address your concern?
Kevin
As Kevin said, but it's also worth noting that
select
passed the indexes of the selected items into your function, so you can do something like this;Colin