details.drop is true even when table.colReorder.reset() is called, is this correct?
details.drop is true even when table.colReorder.reset() is called, is this correct?

I am using DataTables column-reorder 1.5.2 with colReorder.realtime
set to false
and when I drag and drop a column everything looks good and I am able to eval details.drop
as a mouse drop because details.drop
is true
. The problem I see is that when I call colReorder.reset()
to reset the columns to the original initialized state, column-reorder
is called and details.drop
is true
again. this makes it difficult to handle things like highlighting a button or something indicating that columns have been reordered or reset.
Is details.drop
supposed to be true
for a colReorder.reset()
event? I wouldn't think so as the documentation states:
boolean
drop
- Indicate if this event is the result of a mouse drop (i.e. the user has finished moving the columns). This is useful to distinguish between a live reorder and the final state. Requires ColReorder 1.2.1 or newer.
Answers
Right - there is some ambiguity there! The idea of the
drop
parameter was to allow better performance - it will be true for the final action and recalculations need to be performed. So yes, I would expect it to be true in this case since you need to perform the calculations once the columns have been reordered. I need to update the docs to reflect that better.Allan