alumuko / vanilla-datetimerange-picker

A JavaScript component that is a date & time range picker, no need to build, no dependencies except Moment.js, that is based on Dan Grossman's bootstrap-daterangepicker.
MIT License
149 stars 17 forks source link

[AJAX] Can we reinitialize the plugin ? #14

Closed kopax-polyconseil closed 1 year ago

kopax-polyconseil commented 1 year ago

Hello, we use flask with turboframe. Turbo does ajax request to get HTML, and inject it into the dom.

Those DOM manipulation can break any JS binded.

Hopefully we have hook before and after that ajax request.

I would like to know if it's possible to uninitialize then reinitialize and how ? (kind of unbindEvent/bindEvent + any dom unitialization/initialization)

kopax-polyconseil commented 1 year ago

I found a non documented .remove() method, which I believe work for my use case.