sindu12jun / table-dragger

Turn your old table to drag-and-drop table with columns and rows sorting like magic!
https://sindu12jun.github.io/table-dragger/
MIT License
750 stars 128 forks source link

Dynamically Injected table Column, is not draggable #29

Closed javmah closed 6 years ago

javmah commented 6 years ago

Excellent piece of code but there is a Problem. Dynamically Injected a table Column, is not draggable. I insert table Column with Class name "handle sindu_handle" but it didn't work, Anyone Have any Suggestion or fix for this. regards.

ekzobrain commented 6 years ago

Hi.

The same for rows. This can be easily fixed with binding mousedown event to table itself, but not to cells. This wil also improve performance on large tables significantly and reduce code size.

ekzobrain commented 6 years ago

@sindu12jun I see you have not updated this lib for a long time, do you plan to fix bugs/develop it further?

sindu12jun commented 6 years ago

@soulhunter1987 thanks a lot for your excellent idea, i'm gonna fix this bug

sindu12jun commented 6 years ago

@javmah , before injecting the column, you can destroy the table-dragger, and rebuild the table-dragger after injecting. for example:

const dragger = tableDragger(tableDom) dragger.destroy() // inject column tableDragger(tableDom)