EasyUI Forum

General Category => General Discussion => Topic started by: featheral on October 28, 2019, 12:08:17 AM



Title: calendar: overloaded 'onSelect'. datebox no-longer get filled with selected date
Post by: featheral on October 28, 2019, 12:08:17 AM
Hi.
I am using a datebox.
Code:
$("#foo").datebox('calendar').calendar({
    validator: someValidatorFunc,
})

When I click on a date, the date gets pasted into the input field. All's well.


Then I added this handler:

Code:
$("#foo").datebox('calendar').calendar({
    validator: someValidatorFunc,
    onSelect: function () {
        //..
    }
})

Clicking on a date now has no effect: the calender stays open, and the input field does not get filled with the selected date.

Could it be that attaching an 'onSelect' handler breaks datebox? Is onSelect required to return some value, or call some function?

Thanks,



Title: Re: calendar: overloaded 'onSelect'. datebox no-longer get filled with selected date
Post by: jarry on October 29, 2019, 08:18:13 PM
The calendar's 'onSelect' has been used by datebox component, please use this code instead.
Code:
$('#db').datebox({
onSelect: function(date){
console.log(date)
}
}).datebox('calendar').calendar({
validator: someValidatorFunc
})