Apr 18, 2013, 1:41 PM
[CLOSED] Problem with client overrides
Hi,
I'm trying to put some custom override code in a centralized location that will be registered and included on every page. That works to some degree, however, I've encountered a problem. If specific UX controls are not physically present on a page, their Ext resources will not be included by default and the override will throw a client error.
I'm trying to put some custom override code in a centralized location that will be registered and included on every page. That works to some degree, however, I've encountered a problem. If specific UX controls are not physically present on a page, their Ext resources will not be included by default and the override will throw a client error.
Ext.override(Ext.ux.Multiselect, {
onViewBeforeClick: function (vw, index, node, e) {
this.preClickSelections = this.view.getSelectedIndexes();
if (this.disabled || this.readOnly || (this.preventDeselect && this.preClickSelections.indexOf(index) != -1)) {
return false;
}
}
});
This resource is included by Ext framework at runtime I believe wherever the Multiselect control is present but otherwise it's missing causing an "undefined" error when the override code is parsed:<script type="text/javascript" src="/ux/extensions/multiselect/multiselect-js/ext.axd?v=12127"></script>
Could you recommend a generic way of handling this problem?
Last edited by Daniil; Apr 18, 2013 at 2:42 PM.
Reason: [CLOSED]