AlanP
AlanP

Reputation: 447

How to change text in back button in a detailed view sencha touch?

What is the proper way to change the back button text?

    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}'],
    }
    });
    

Upvotes: 0

Views: 113

Answers (2)

AlanP
AlanP

Reputation: 447

The backbutton text is set in the navigation view before displaying the detailed view.

    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>

Upvotes: 1

OhmzTech
OhmzTech

Reputation: 897

You are extending Ext.Panel. Ext.Panel does not accept the navigationBar configuration, you probably want to use Ext.navigation.View. Then on that view you can pass the defaultBackButtonText property. Otherwise if you want to customize the button further, inside of navigationBar object you want to specify a button object with button properties.

Upvotes: 0

Related Questions