【问题标题】:sencha touch change toolbar with Ext.Carousel带有 Ext.Carousel 的 sencha 触摸更改工具栏
【发布时间】:2011-11-23 16:08:29
【问题描述】:

我有一个带有 3 个项目的轮播,我有 1 个工具栏。但是如何根据轮播显示的项目更改工具栏的标题?例如:

var theCarousel = new Ext.Carousel({
                ui: 'dark',
                direction: 'horizontal',
                defaults: { cls: 'card', layout:'fit' },
                items: [
                    { 
                     html:'<b>I'm big</b>'
                    },
                    {
                     html:'<i>I'm oblique</i>'
                    },
                    {
                     html:'<u>I'm underlined</u>'
                    }

});


var toolbar = new Ext.Toolbar({
                          title: 'iToolbar' ,
                          dock: 'top',
                          items:[
                              {
                                  text:'back',
                                  ui:'back'

                              },{xtype: 'spacer'},
                              {
                                  text:'Help',
                                  ui:'help'
                              }   

                          ]
              });

 var panel = new Ext.Panel({
                fullscreen: true,
                layout: {
                    type : 'fit',
                    align: 'top'
                },
                defaults: {
                    flex: 1
                },
                items: [ theCarousel ],
                dockedItems: [ toolbar ]
            });
   panel.show();

所以当我在“我是倾斜的”项目时,我希望工具栏的标题显示“我是倾斜的” 关于如何做到这一点的任何想法?泰,已经!

【问题讨论】:

    标签: sencha-touch extjs


    【解决方案1】:

    当每张新牌出现时,Ext.Carousel 会触发 cardSwitch 事件。此事件的处理程序将接收新的卡片组件作为第二个参数。你可以这样做

    panel.setTitle(newCard.getYourTitle());

    在处理程序中。

    【讨论】:

      猜你喜欢
      • 2011-12-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-05-24
      • 1970-01-01
      • 2011-07-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多