Way to tell if select event came from mouse click or programmatically?
Way to tell if select event came from mouse click or programmatically?
BarryB
Posts: 4Questions: 1Answers: 0
Using $('#myTable').DataTable().on('select', function (e, dt, type, indexes)
to capture select events.
However, I populate the table initially from external data where some rows are already selected. I only want to know when the user takes action i.e. clicks. Looked through all the arguments but nothing seemed obvious.
Thanks in advance!
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Use the
user-select
event for this.Kevin
Thanks this basically works. This event appears to fire before the select/deselect events, so I look at the
originalEvent
to determine what the semantic is:Sort of feels a little hacky ... not sure there's a better way though.
This thread has a similar comment with one of the developer's responses.
Kevin
Thanks. Posted a comment there.