【发布时间】:2014-08-17 10:03:57
【问题描述】:
是否可以在 ExtJs 4 中覆盖侦听器。 我的代码如下:
Ext.define('app.view.SearchForm', {
extend: 'Ext.form.Panel',
alias : 'widget.searchform',
items: [
{
xtype: 'radiogroup',
id: 'type',
items: [
{boxLabel: 'Individual', id: 'ind', name: 'clientType', value: 'x',inputValue: 'x', checked: true},
{boxLabel: 'Non-Individual', id: 'nind', name: 'clientType', value: 'y', inputValue: 'y'}
],
listeners: {
change: function( radiogroup, checked ) {
// event code here
}
}
]
});
现在如何在一个新的 js 文件中覆盖监听器,如下所示:
Ext.define('app.view.newSearchForm',{
override: 'app.view.SearchForm',
alias: 'widget.newSearchForm'
// how to override the listener
});
是否可以像覆盖方法一样覆盖侦听器?
【问题讨论】:
标签: extjs overriding listeners