【问题标题】:How can I display the same panel multiple times?如何多次显示同一个面板?
【发布时间】:2011-09-13 14:18:09
【问题描述】:

我想我的问题很基本,但无论如何我都需要帮助.. 问题是.. 我有一个带有 5 张卡片(即面板)的旋转木马,在这个面板内我想调用其他相同的面板全部5张卡..

为了举例说明我的意思,这里有一些代码示例:

//Here I'm creating the panel

this.testeCard(); 

MYPROJ.UI.prototype.testeCard = function(){
var teste = new Ext.Panel({
    html: 'teste teste teste',
    style: 'background-color: #2f7da8'
});
this._registerView(teste,'teste');
return teste;
};

//Here I'm calling it

MYPROJ.UI.prototype.currentCard = function(){
var currentCard = new Ext.Panel({
    id: 'currentCard',
    cls: 'mainPanel',
    //html: 'currentCard',
    items:[
        this.getView('teste')   //Fine here
    ]
});        
this._registerView(currentCard, 'currentCard');
return currentCard;    
};

MYPROJ.UI.prototype.anotherCard = function(){
var currentCard = new Ext.Panel({
    id: 'currentCard',
    cls: 'mainPanel',
    //html: 'currentCard',
    items:[
        this.getView('teste')   
    ]
});        
this._registerView(currentCard, 'currentCard');
return currentCard;    
};

所以,我想做的是在“currentCard”和“anotherCard”中都调用这张“teste”卡

我该怎么做????

【问题讨论】:

    标签: sencha-touch panel extjs carousel


    【解决方案1】:

    也许这对你有帮助..

    teste.show();
    teste.setActiveItem(currentCard, 'slide');
    
    teste.show();
    teste.setActiveItem(anotherCard, 'slide');
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-12-12
      • 2022-07-21
      • 1970-01-01
      • 1970-01-01
      • 2010-10-25
      • 2013-03-04
      相关资源
      最近更新 更多