如何在详细查看sencha touch中更改后退按钮中的文本?

时间:2013-12-28 22:03:56

标签: sencha-touch

更改后退按钮文字的正确方法是什么?     

    Ext.define('myapp.view.post.PostDetail', {
    extend: 'Ext.Panel',
    alias: 'widget.postdetailpage',
    xtype: 'postdetailpage',
    config: {
    navigationBar: {
        config: {
            //change the back button text?
            defaultBackButtonText: 'Go Back',
            useTitleForBackButtonText: false
        }
    },
    scrollable: 'vertical', 
    styleHtmlContent: true,
    tpl: ['{content}'],
    }
    });
    

2 个答案:

答案 0 :(得分:1)

在显示详细视图之前,会在导航视图中设置后退按钮文本。     

    Ext.define('mimo.view.PostPanel', {
        extend: 'Ext.NavigationView',

xtype: 'postPanel', requires: [ 'mimo.view.post.PostList' ], config: { title: 'Blog', iconCls: 'home', // set the back button text here defaultBackButtonText: 'Volver', items:[{ title: 'Las entradas de blog', xtype: 'postlist' }] } }); </pre>

答案 1 :(得分:0)

您正在扩展Ext.Panel。 Ext.Panel不接受navigationBar配置,您可能希望使用Ext.navigation.View。然后在该视图上,您​​可以传递defaultBackButtonText属性。否则,如果要进一步自定义按钮,则需要在navigationBar对象内指定具有按钮属性的按钮对象。

相关问题