Skip to content

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

@wnunezc

Description

@wnunezc

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');
    })
} 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions