0

学习煎茶触摸,已经爱上它了。在我看来,比 JQTouch 好得多。只是在处理我的一些应用程序想法,我需要有 2 个选项卡,其中第一个选项卡将包含一个带有一些数据的 ext.List。我已经走了这么远,但是有一个我无法弄清楚的问题。

问题:当我触摸列表中的名称时,不会显示详细信息面板。当它不在选项卡面板中时,我完全没有问题。试过论坛,找不到解决办法。

这是我的整个代码(基于许多示例):

ShotjesApp = new Ext.Application({
name: "Shotjes",
launch: function() {

    ShotjesApp.detailPanel = new Ext.Panel({
        id: 'detailpanel',
        tpl: 'Omschrijving: {Naam} <br> <br> {Inhoud}',
        dockedItems: [
            {
                xtype: 'toolbar',
                items: [{
                    text: 'terug',
                    ui: 'back',     
                    handler: function() {
                    ShotjesApp.Viewport.setActiveItem('listwrapper', {type:'slide', direction:'right'});
                    }
                }]
            }
        ]
    });

    ShotjesApp.listPanel = new Ext.List({
        id: 'disclosurelist',
        store: ListStore,
        itemTpl: '<div class="contact">{Naam} {Basis}</div>',
        grouped: true,
        onItemDisclosure: function(record, btn, index) {
    var naam = record.data.Naam;
            ShotjesApp.detailPanel.update(record.data);
            ShotjesApp.Viewport.setActiveItem('detailpanel') //THIS WON'T WORK?
    ShotjesApp.detailPanel.dockedItems.items[0].setTitle(naam);
        }
    });

    ShotjesApp.listWrapper = new Ext.Panel ({
        id: 'listwrapper',
        layout: 'fit',
        items: [ShotjesApp.listPanel],
        dockedItems: [
                    {
                    dock : 'top',
                    xtype: 'toolbar',
                    title: 'Shotjes'

    }],

                });

this.mainView = new Ext.TabPanel({ 
    tabBar: { 
            dock: 'bottom', 
            ui: 'dark', 
            layout: { pack: 'center' } 
        }, 
    cardSwitchAnimation: { 
            type: 'fade', 
            cover: true 
        },  

    items:[{
title: 'Shotjes', 
        cls: 'card 1', 
        id: 'card 1', 
        items: [ShotjesApp.listWrapper, ShotjesApp.detailPanel] ,
        iconCls: 'home', 
        layout: 'card', 

    }, {
        title: 'About', 
        cls: 'card 2', 
        id: 'card 2', 
        html: 'about',
        iconCls: 'calendar', 
        layout: 'card', 
    }


    ],

    tabBarDock: 'bottom', 
    fullscreen: true, 
    layout: 'fit' 
}); 

this.Viewport = this.mainView; 
} 

});

4

2 回答 2

0

酷,谢谢。我还添加了这个,否则幻灯片将作为新标签打开:

    ShotjesApp.Viewport = new Ext.Panel ({
        fullscreen: true,
        layout: 'card',
        cardSwitchAnimation: 'slide',
        items: [ShotjesApp.listWrapper, ShotjesApp.detailPanel]
    });

结合您的更改,它可以完美运行..

一个巨大的问题。因为视口是全屏的,所以当我按下第二个选项卡时不会显示它。当我将第二个选项卡设置为 Fullscreen: true 时,我看到了动画,但第一个选项卡仍在其顶部。

当我在视口中更改 fullscreen: false 时,旧问题又回来了,并且不会显示详细信息窗格。

于 2011-08-19T16:01:47.303 回答
0

尝试这个

ShotjesApp.Viewport.setActiveItem(ShotjesApp.detailPanel);

同样在您的代码中缺少分号。

于 2011-08-19T15:33:01.373 回答