点击后如何进入根面板? - Sencha Touch

时间:2013-08-21 07:25:02

标签: sencha-touch-2

我为平板电脑创建视图。查看我的图片:
http://i.stack.imgur.com/rwFuu.png

在左边的列表项中是类别,右边的列表项是数据。

当我点击左边的项目时。右边是推到新面板。当我再次点击左边的项目。右边是按下新面板重叠。当我点击后退按钮不是根面板。

如何输入代码?

这是我的代码: 视图:

Ext.define('Project-catalog.view.tablet.Home', {
    extend: 'Ext.navigation.View',
    xtype: 'tablet-homepanel',
    requires: [ 
        'Project-catalog.store.appsAll'
    ],
    config: {
        defaultBackButtonText: 'ย้อนกลับ',
        // useTitleAsBackText: false,
        activeItem: 1,
        id: 'mynavigationview',
        title: 'All',
        iconCls: 'list',
        cls: 'home',
        styleHtmlContent: true,
        tabBarPosition: 'bottom',
        items:[
            {
                title: "All Apps",
                xtype: 'list',
                id:'Applist',
                store: 'appsAllID',
                itemTpl: new Ext.XTemplate(
                    '<img src="http://61.47.41.108:9999/system/appinfos/appicons/000/000/{id}/original/{appicon_file_name}" width="50" heigh="50" style="float:left;clear:both;"></img>',
                    '<div style="margin-left: 60px;word-wrap: break-word;width:80%;">',
                    '<span style="font-size:16px;">{name}</span><br>',
                    '<span style="font-size:13px;color:#7C7C7C;" id="catname">{categoryname}</span>',
                    '</div>'    
                ),
                masked: {
                    xtype: 'loadmask',
                    message: 'Please wait'
                }
            },
            {
                width: 300,
                dock: 'left',
                title: 'Categories',
                xtype: 'tablet-navigation'
            }
        ]
    }
});

控制器:

showCatQuery: function(list,index,element,record){
        var catid = record.get('id');
        var catname = record.get('name');
        this.getHomepanel().add({
            xtype: 'panel',
            title: catname,
            scrollable: true,
            styleHtmlContent: true,
            layout: {
                type: 'fit'
            }, 
            items: [
                {
                    catid: catid,
                    xtype: 'tablet-showSearchCategory'
                }
            ]
        });
    }

对不起!我英文不好。

0 个答案:

没有答案