如何使XTemplate与Sencha Touch中的TabPanel一起使用

时间:2011-05-16 20:56:15

标签: sencha-touch tabpanel

我已按预期生成TabPanels,但是,如果我尝试将XTemplate注入其中一个面板,然后调用content.update(myArray);,结果是面板不会移动,按钮不起作用,模板不呈现。

谁能告诉我我做错了什么?

<script type="text/javascript">
    Ext.setup({
        onReady: function () {
            var rootPanel,
                videoPanel,
                aboutPanel,
                videoTpl,
                bergman,
                gray,
                videosToShow

            bergman = { id: "23657322" };
            gray = { id: "23694183" };
            videosToShow = [bergman, gray];

            videoTpl = new Ext.XTemplate(
                '<tpl for=".">',
                '<iframe src="http://player.vimeo.com/video/{id}?title=0&amp;byline=0&amp;portrait=0&amp;color=80ceff" ',
                'width="400" ',
                'height="225" ',
                'frameborder="0">',
                '</iframe>',
                '</tpl>'
            );

            videoPanel = {
                title: "Videos",
                tpl: videoTpl,
                iconCls: "tv",
                badgeText: "1",
                dockedItems: [{ xtype: "toolbar", title: "Videos"}],
                scroll: "vertical"
            };

            aboutPanel = {
                title: "About",
                html: "About RockPointe Church.",
                iconCls: "more",
                dockedItems: [{ xtype: "toolbar", title: "About"}],
                scroll: "vertical"
            };

            rootPanel = new Ext.TabPanel({
                fullscreen: true,
                layout: 'card',
                items: [videoPanel, aboutPanel],
                tabBar: { dock: 'bottom' }
            });

            content.update(videosToShow);
        }
    });
</script>

1 个答案:

答案 0 :(得分:1)

我想通了

我需要videoPanel.update(videosToShow);

我也不得不改变 videoPanel = {

videoPanel = new Panel({