extjs 7.x classic ux包
使用treepicker绑定store时报错:
TypeError: Cannot read properties of null (reading ‘$eventOptions’) at constructor.addManagedListener (Observable.js?_dc=1641516240871:577) at constructor.aliasOneMember. [as mon] (Base.js?_dc=1641516240871:1175) at constructor.initComponent (TreePicker.js?_dc=1641516240875:67) at constructor (Component.js?_dc=1641516240871:2268)
绑定在beforerender中初始化 treepicker时在initComponent中给store添加事件监听,此时绑定尚未初始化,store值为null,导致异常
覆盖默认实现,改为在updateStore时添加事件监听
Ext.define('PSR.overrides.Ext.ux.TreePicker', {
override: 'Ext.ux.TreePicker',
initComponent: function() {
var me = this;
this.store = this.store || Ext.data.StoreManager.lookup('ext-empty-store');
me.callParent(arguments);
},
updateStore:function(store){
this.mon(store, {
scope: this,
load: this.onLoad,
update: this.onUpdate
});
},
});
node_modules/@sencha/ext-ux/classic/src/TreePicker.js
initComponent: function() {
var me = this;
me.callParent(arguments);
me.mon(me.store, {
scope: me,
load: me.onLoad,
update: me.onUpdate
});
},
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有