EasyUI Forum
October 10, 2024, 11:26:57 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: 1 [2]
  Print  
Author Topic: datebox calendar error  (Read 11901 times)
Coder
Jr. Member
**
Posts: 96


View Profile
« Reply #15 on: February 07, 2020, 06:12:10 PM »

Thnx 4 reply!

My advice:

datebox.js
Code:
// ...
// line 62
$.extend(state.calendar.calendar('options'), {
fit:true,
border:false,
onSelect:function(date){
var target = this.target;
var opts = $(target).datebox('options');
var calendar = $(target).datebox('calendar'); // +
opts.onSelect.call(target, date);
calendar.calendar('moveTo', date); // +
setText(target); // +
// - setValue(target, opts.formatter.call(target, date));
$(target).combo('hidePanel');
}
});
// ...
// line 128
function doEnter(target){
var state = $.data(target, 'datebox');
var opts = state.options;
var current = state.calendar.calendar('options').current;
if (current){
setText(target); // +
$(target).combo('hidePanel');
// - setValue(target, opts.formatter.call(target, current));
}
}

function setValue(target, value, remainText){
var state = $.data(target, 'datebox');
var opts = state.options;
var calendar = state.calendar;
calendar.calendar('moveTo', opts.parser.call(target, value));
if (remainText){
$(target).combo('setValue', value);
} else {
setText(target); // +
// - if (value){
// - value = opts.formatter.call(target, calendar.calendar('options').current);
// - }
// - $(target).combo('setText', value).combo('setValue', value);
}
}

function setText(target){  // +
var state = $.data(target, 'datebox')
, opts = state.options
, calendar = state.calendar
, value = opts.formatter.call(target, calendar.calendar('options').current)
;
$(target).combo('setText', value).combo('setValue', value);
}
}


// ...
// line 224
setDate: function(jq, date){
return jq.each(function(){
var opts = $(this).datebox('options');
$(this).datebox('calendar').calendar('moveTo', date);
// - setValue(this, date ? opts.formatter.call(this, date) : '');
setText(this); // +
});
},


« Last Edit: February 07, 2020, 06:17:32 PM by Coder » Logged
Pages: 1 [2]
  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!