Override zk error box on click fuction and prologHTML_ box customization in zk
If you need to customized client side constraint errorbox message behaviour using zk you can do it by overriding Errorbox.js file
1) This is my override js fuction
here i override prologHTML function and doClick_ function in Errorbox.js file
prologHTML is used to create message box user interface
doClick_ is used to change behavoioutr of message box
zk.afterLoad('zul.inp', function () {
zk.override(zul.inp.Errorbox.prototype, {}, {
prologHTML_ : function(a) {
var b = this.uuid;
a.push('<div id="', b);
a.push('-a" class="z-errbox-left z-arrow" title="');
a.push(zUtl.encodeXML(msgzk.GOTO_ERROR_FIELD));
a.push('"><div id="', b,'-c" class="z-errbox-right z-errbox-close" title="Close"><div class="z-errbox-center">');
a.push(zUtl.encodeXML(this.msg, {multiline : true}));
a.push("</div></div></div>");
},
doClick_: function (evt) {
var p = evt.domTarget;
if (p == this.$n('c')) {
if ((p = this.parent) && p.clearErrorMessage) {
p.clearErrorMessage(true, true);
} else
zAu.wrongValue_(p, false);
} else {
this.$supers('doClick_', arguments);
this.parent.focus(0);
}
}
});
});
No comments:
Post a Comment