0

更改或点击 TabPanel 的图标时,我需要更改标题栏文本。我创造了

酒吧.js

Ext.define('myapp.view.Myclass', {
   extend: 'Ext.Titlebar',

   config: {
      title: '',
   }
})

视口.js

Ext.define('myapp.view.Viewport' , {
extend: 'Ext.TabPanel',

config: {
      tabBarPosition: 'bottom',
      items: [
         {
            xtype: 'myicon1'
         },
         {
            xtype: 'myicon2'
         },
      ]
    }
})

MyIcon1.js

Ext.define('myapp.view.MyIcon1', {
extend: 'Ext.Panel',
xtype: 'myicon1',

   config: {
     ...
   }
})

因此,当我在标题栏上动态点击图标的更改标题时。谢谢我需要帮助。

4

1 回答 1

1

Just listen to the activeitemchange events on the tabpanel :

activeitemchange: function( container, value, oldValue, eOpts ){
  ...
}

Within this function, just get the name of the new tab from the value parameter and set the title to your titlebar.

Hope this helps

于 2012-07-10T14:26:09.323 回答