Estoy tratando de anular el evento onRender en ExtJS 3.4.0 pero esto da un error de secuencia de comandos: el objeto no es compatible con callParent. Mi objetivo es habilitar o deshabilitar botones según los derechos del objeto de sesión.
Ext.override(Ext.Button, { onRender: function () { this.callParent(); console.log('do something'); } });Lo he resuelto con estas líneas de código:
Ext.onReady(function () { Ext.QuickTips.init(); // get rights here if (roles.length > 0) { Ext.override(Ext.Button, { initComponent: function () { //filter rights here with matching text // if length is greater than 0, then enable disable buttons if (buttonRights.length > 0) { if (this.text == buttonRoles[0].ItemText) { this.setDisabled(!roles[0].IsAllowed); } } } }); } });