【问题标题】:ExtJS 5 create dynamic panel from objectExtJS 5 从对象创建动态面板
【发布时间】:2016-01-09 23:30:25
【问题描述】:

假设我有对象

var obj = {
  xtype: 'panel',
  title: 'other panel'    
}

我想从中获得动态面板。 我想要这样的东西:

var obj = {
      xtype: 'panel',
      title: 'other panel'    
    }
var panel = Ext.create(obj); //not work of course

然后绑定事件

panel.on('added', function(){console.log('hello world'});

怎么可能?

【问题讨论】:

    标签: extjs panel


    【解决方案1】:

    尝试改用Ext.widget,例如:

    var panel = Ext.widget(obj.xtype, obj);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-10-02
      • 1970-01-01
      • 1970-01-01
      • 2018-10-18
      • 2014-01-01
      相关资源
      最近更新 更多