IDEMPIERE-1287:When editing in a field (header or detail) use shortcut key (alt + next) to move next record. value in this field is not save

This commit is contained in:
hieplq 2016-09-04 21:38:49 +07:00
parent 0d0ce41a4b
commit 2f41998354
2 changed files with 13 additions and 2 deletions

View File

@ -96,7 +96,8 @@ zkforge.KeyListener = zk.$extends(zul.Widget, {
}
evt.preventDefault();
// _autoBlur = true will let current focus control blur but this event is sent after key event, so haven't valuable
id.zk.Extend.fakeOnchange (zk.currentFocus);
zAu.send(new zk.Event(zk.Widget.$(this), 'onCtrlKey', {keyCode: keycode, ctrlKey: evt.ctrlKey, shiftKey: evt.shiftKey, altKey: evt.altKey}, {toServer: true}));
return false;

View File

@ -15,7 +15,17 @@ Copyright (C) 2007 Ashley G Ramdass.
zk.afterLoad(function() {
zk._Erbx.push = function(msg) {
if (console) console.log(msg);
}
};
zk.$package('id.zk');
id.zk.Extend = zk.$extends(zk.Object, {}, {
fakeOnchange: function (wgt) {
// just sent fake event when control is textfield and value is not yet sync to server
if (wgt.$instanceof(zul.inp.Textbox) && wgt.$n().value != wgt.getText())
zAu.send(new zk.Event(zk.Widget.$(wgt), 'onChange',{"value":wgt.$n().value}));
}
});
});
zk.afterLoad(function() {