0

现在,我在导航视图中添加了额外的按钮。当我触摸 itemtap 以查看更多详细信息并在详细信息视图中触摸返回按钮时,没有显示额外的按钮。

请有人帮助我。谢谢你。

对不起,我英语不好

这是我的代码:

我的观点:

Ext.define('Catalog.view.Home', {
    extend: 'Ext.navigation.View',
    xtype: 'homepanel',
    config: {
        navigationBar: {
            items: [
                {
                    xtype: 'button',
                    text: 'categories',
                    id: 'category',
                    translate: true,
                    translationKey: 'navigationbar.category',
                    align: 'left'
                }
            ]
        },
        defaultBackButtonText: 'All Apps',
        title: 'All',
        iconCls: 'list',
        cls: 'home',
        styleHtmlContent: true,
        tabBarPosition: 'bottom',
        items:[
            {
                title: "All Apps",
                xtype: 'list',
                itemTpl: new Ext.XTemplate(
                    '<img src="http://127.0.0.1:3000/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>',
                    '<tpl for="categories">',
                    '<span style="font-size:13px;color:#7C7C7C;" id="catname">{name}</span>',
                    '</div>',
                    '</tpl>'

                ),
                store: {
                    autoLoad: true,
                    fields: ['id','name','created_at','appicon_file_name','categories','url_ios','url_android','gallery_apps','description'],
                    sorters: [{
                        property:'created_at',
                        direction:'DESC'
                    }],
                    proxy: {
                        type: 'jsonp',
                        url: 'http://127.0.0.1:3000/appinfos.json',
                        reader:{
                            type: 'json',
                            rootProperty:'responseData.entries'
                        }   
                    }
                }
            }
        ]
    },
    initialize: function() {
        this.callParent();
        var helpBtn = this.getNavigationBar().query('#category');
        helpBtn[0].textElement.dom.innerHTML = "Categories";
    }
});

我的控制器:

Ext.define('Catalog.controller.Main', {
    extend: 'Ext.app.Controller',

    config: {
        refs: {
            homepanel: 'homepanel',
            but: 'homepanel #category'    
        },
        control: {
            'homepanel list':{
                itemtap: 'showApp',
                back: 'backButtonHandler'
            }
        }
    },
    backButtonHandler: function(button) {
        this.getBut().setHidden(false); 
    },

    //called when the Application is launched, remove if not needed
    showApp: function(list,index,element,record) {
        this.getBut().setHidden(true);
    }
});

更新

现在,我的问题解决了!

谢谢

4

0 回答 0