Ext.getCmp(Ext组件ID),根据Ext组件的ID选择EXT组件。

例如:点击Panel->toolbar上的button改变Panel的标题

Ext.onReady(function(){
    Ext.create('Ext.panel.Panel', {
        id: 'myPanel',
        title: 'Ext Panel',
        renderTo: Ext.getBody(),
        width: 300,
        height: 200,
        dockedItems: [
            {
                xtype: 'toolbar',
                dock: 'top',
                items: [
                    {
                        text: 'click me',
                        handler: function(){
                            Ext.getCmp('myPanel').setTitle('Change Panel Title');
                        }
                    }
                ]
            }
        ]
    });
});

 

相关文章:

  • 2021-04-25
  • 2021-05-22
  • 2022-12-23
  • 2021-11-30
  • 2021-12-02
  • 2021-12-02
  • 2021-12-16
  • 2021-12-06
猜你喜欢
  • 2021-08-18
  • 2021-07-13
  • 2022-01-05
  • 2022-12-23
  • 2021-10-14
  • 2021-09-23
  • 2021-06-02
相关资源
相似解决方案