gpt4 book ai didi

javascript - 在运行时向 senchas carousell 添加东西的正确方法

转载 作者:行者123 更新时间:2023-11-30 17:27:59 24 4
gpt4 key购买 nike

那么如何在 sencha touch 2.x 中向 carousell 添加内容?

var c = Ext.create('Ext.Carousel', {
fullscreen: true,

defaults: {
styleHtmlContent: true
},

items: [
{
html : 'Item 1'
}]
});

例如,如果我想将 form f 推送到 carousell,我该怎么做?我已经尝试过 c.push(f)c.add(f) 但我看不到我的表单被添加到那里。

最佳答案

将东西添加到像 Ext.Carousel 这样的容器中的正确方法是使用 add() 函数。如果您想在运行时将所有内容添加到其中,您也可以像这样定义轮播:

var c = Ext.create('Ext.Carousel', {
fullscreen: true,

defaults: {
styleHtmlContent: true
}

});

现在您可以使用c.add(f) 函数了。此外,要从轮播或其他容器 c 中删除对象 f,请使用 c.remove(f)

关于javascript - 在运行时向 senchas carousell 添加东西的正确方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23845737/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com