将监听器添加到基本表单字段或字段集

时间:2011-11-08 23:01:05

标签: extjs3

在ExtJS 3中,我该如何改变基本的Ext.form.Field和Ext.form.Field,以便它们都为“隐藏”事件设置一个监听器?

我尝试过使用Ext.apply和Ext.override都无济于事。我不想使用Extend,因为那时我必须扩展每个不同的字段类型。

1 个答案:

答案 0 :(得分:0)

Ext.override(Ext.form.Field, {
  initComponent: Ext.form.Field.prototype.initComponent.createSequence(function(){
    this.on({
      ...
    });
  })
});