如何多次显示同一面板?

时间:2011-09-13 14:18:09

标签: sencha-touch panel extjs carousel

我想我的问题是如此基本但我无论如何都需要帮助..事情是......我有一张带有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'卡

我该怎么办?

1 个答案:

答案 0 :(得分:0)

可能这可以帮到你..

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

teste.show();
teste.setActiveItem(anotherCard, 'slide');
相关问题