将元素添加到轮播sencha
|
在sencha touch中,我有一个这样的轮播声明:
ajaxNav = new Ext.Panel({
scroll: \'vertical\',
cls: \'card1 demo-data\',
styleHtmlContent: true,
layout: {
type: \'vbox\',
align: \'stretch\'
},
defaults: {
flex: 1
},
items: [{
xtype: \'carousel\',
items: [{
id:\'tab-1\',
html: \'\',
cls: \'card card1\'
},
{
id:\'tab-2\',
html: \'<p>Clicking on either side of the indicators below</p>\',
cls: \'card card2\'
},
{
id:\'tab-3\',
html: \'Card #3\',
cls: \'card card3\'
}]
}]
});
有人知道如何动态添加元素吗?
没有找到相关结果
已邀请:
1 个回复
澳绍能
}); 如您所见,在“添加”按钮事件上,您首先必须根据需要定义面板,然后将其添加到轮播中,最重要的是,您必须让轮播重新计算其布局调用\“ doLayout()\”函数。 希望这可以帮助。