EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: Coder on August 09, 2020, 10:25:57 PM



Title: repaint/redraw calendar
Post by: Coder on August 09, 2020, 10:25:57 PM
Hi !

Have datebox :
Code:
		$('#sTo').datebox().datebox('calendar').calendar({
validator: function(date){
var d1 = new Date($('#sDate').prop('sMin')||0);
var d2 = new Date($('#sDate').prop('sMax')||0);
return d1<=date && date<=d2;
}
,styler: function(date){
var d1 = new Date($('#sDate').prop('sMin')||0);
var d2 = new Date($('#sDate').prop('sMax')||0);
return (d1<=date && date<=d2)?'background-color:#0c0':'';
}
});

How repaint calendar when set new values to '#sDate' propertys

Code:
$('#sDate').prop('sMin',aMin).prop('sMax',aMax);

$('#sTo').datebox().datebox('calendar').calendar('repaint'); // ;) ???

?

Thanxx


Title: Re: repaint/redraw calendar
Post by: jarry on August 12, 2020, 04:39:14 PM
Call this line to repaint the calendar.
Code:
$('#sTo').datebox('calendar').calendar();