Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reset/remove/destroy element binded with timepiker 2021 and BS4 #394

Open
arcanisgk opened this issue Jan 8, 2021 · 0 comments
Open

reset/remove/destroy element binded with timepiker 2021 and BS4 #394

arcanisgk opened this issue Jan 8, 2021 · 0 comments

Comments

@arcanisgk
Copy link

arcanisgk commented Jan 8, 2021

if any is working with this library and need reset/remove/destroy element binded with timepiker and not work correctly, i have done with this:

var date1 = $('[name="i_hou_1"]'); //input related to timepicker
var date1div = date1.closest(".input-group.bootstrap-timepicker.time");  //input-addon related to timepicker (class can variate)

window.DatepickersDestroy(date2div); //global call to the method

function TimePickerDestroy(target) {
    target.find("input:text").each(function () {
        var picker = $(this);
        picker.timepicker('remove');
        picker.off('click');
    });
    target.find("*").each(function () {
        var picker = $(this);
        picker.off('click');
        picker.off('.timepicker');
    })
} 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant