EasyUI Forum
April 29, 2024, 03:53:37 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: calendar: overloaded 'onSelect'. datebox no-longer get filled with selected date  (Read 5240 times)
featheral
Newbie
*
Posts: 14


View Profile
« 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,

Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 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
})
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!