Multiple-Dates-Picker-for-jQuery-UI
Multiple-Dates-Picker-for-jQuery-UI copied to clipboard
destroy and re-init again not working
Hello all,
first init datepicker with option disabled true, when select other dropdown to activate datepicker with option disabled false and others option, not working to click in calendar.
$("#calendar").multiDatesPicker({
altField: '#date_result',
dateFormat: "yy-mm-dd",
disabled: true,
});
$("#status").on('change', function() {
var parent = $(this);
var value = parent.val();
if ( value == '' ) {
$("#calendar").multiDatesPicker('destroy');
$("#calendar").multiDatesPicker({
altField: '#date_result',
dateFormat: "yy-mm-dd",
disabled: true,
});
} else {
$("#calendar").multiDatesPicker('destroy');
$("#calendar").multiDatesPicker({
altField: '#date_result',
dateFormat: "yy-mm-dd",
disabled: false,
});
}
});