Open ghost opened 2 years ago
You bind them to the instance of the initialisation code. I guess you figured it out by now, but this is for others.
var picker_options = {
element: _start_element[0],
elementEnd: _end_element[0],
format: "YYYY-MM-DD",
singleMode: false
setup: (picker) => {
picker.on('before:click', (target) => {
window.alert(1);
});
}
}
var p = new Litepicker(picker_options);
p.on('show', () => {
// some action after show
alert('hello world');
});
I tried to put
into Picker options.
It doesn't work. Where do I put this? Can examples be more detailed, maybe the full snippet for applying the litepicker to an input?