EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: Wojak on February 28, 2023, 02:54:52 AM



Title: Datebox can input 0 and save
Post by: Wojak on February 28, 2023, 02:54:52 AM
Hi,
I have a problem with datebox as editor in datagrid. I can input 0 in day/month/year like '2023-00-12' or '0000-03-14' and it will accept it and save, but if i edit while its '0000-12-1230' it will show as '1900-12-30'.


Title: Re: Datebox can input 0 and save
Post by: jarry on February 28, 2023, 11:31:34 PM
Please rewrite the 'blur' event handler to solve this issue.
Code:
$.extend($.fn.datebox.defaults, {
inputEvents: $.extend({},$.fn.combo.defaults.inputEvents, {
blur: function (e) {
$.fn.combo.defaults.inputEvents.blur(e);
var d = $(e.data.target);
d.datebox('setValue',d.datebox('getValue'));
}
})
});


Title: Re: Datebox can input 0 and save
Post by: Wojak on March 01, 2023, 01:43:19 AM
Works perfect  ;D