Fix onchange event not working for date-range widget

This commit is contained in:
Hadi Nategh 2021-10-22 13:27:37 +02:00
parent 17d4c2a869
commit dddd0a2ee0
2 changed files with 18 additions and 4 deletions

View File

@ -1269,12 +1269,20 @@ var et2_date_range = /** @class */ (function (_super) {
this.from = et2_core_widget_1.et2_createWidget('date', {
id: this.id + '[from]',
blur: egw.lang('From'),
onchange: function () { widget.to.set_min(widget.from.getValue()); }
onchange: function (_node, _widget) {
widget.to.set_min(widget.from.getValue());
if (_node instanceof jQuery)
widget.onchange.call(widget, _widget, widget);
}
}, this);
this.to = et2_core_widget_1.et2_createWidget('date', {
id: this.id + '[to]',
blur: egw.lang('To'),
onchange: function () { widget.from.set_max(widget.to.getValue()); }
onchange: function (_node, _widget) {
widget.from.set_max(widget.to.getValue());
if (_node instanceof jQuery)
widget.onchange.call(widget, _widget, widget);
}
}, this);
this.select = et2_core_widget_1.et2_createWidget('select', {
id: this.id + '[relative]',

View File

@ -1506,12 +1506,18 @@ export class et2_date_range extends et2_inputWidget
this.from = <et2_date>et2_createWidget('date',{
id: this.id+'[from]',
blur: egw.lang('From'),
onchange() { widget.to.set_min(widget.from.getValue()); }
onchange(_node,_widget) {
widget.to.set_min(widget.from.getValue());
if (_node instanceof jQuery) widget.onchange.call(widget, _widget, widget);
}
},this);
this.to = <et2_date>et2_createWidget('date',{
id: this.id+'[to]',
blur: egw.lang('To'),
onchange() {widget.from.set_max(widget.to.getValue()); }
onchange(_node,_widget) {
widget.from.set_max(widget.to.getValue());
if (_node instanceof jQuery) widget.onchange.call(widget, _widget,widget);
}
},this);
this.select = <et2_selectbox><unknown>et2_createWidget('select',{
id: this.id+'[relative]',