c1.documentReady(function () {
var ctls = [];
ctls.push(wijmo.Control.getControl(
'#theInputDate'
));
ctls.push(wijmo.Control.getControl(
'#theInputTime'
));
ctls.push(wijmo.Control.getControl(
'#theInputDateTime'
));
ctls.push(wijmo.Control.getControl(
'#theInputNumber'
));
ctls.push(wijmo.Control.getControl(
'#theComboBox'
));
ctls.forEach(function (ctl) {
addClearButton(ctl)
});
var inputEvent = document.createEvent(
'HTMLEvents'
);
inputEvent.initEvent(
'input'
,
true
,
false
);
function addClearButton(ctl) {
var host = ctl.hostElement,
input = ctl.inputElement;
host.classList.add(
'wj-clear-input'
);
host.addEventListener(
'click'
, function (e) {
if
(e.offsetX < 0 && !wijmo.closest(e.target,
'.wj-state-empty'
)) {
e.stopImmediatePropagation();
input.value =
''
;
input.dispatchEvent(inputEvent);
input.focus();
}
},
true
);
}
});