1. #1
    Sencha User
    Join Date
    Jan 2012
    Location
    Rennes - France
    Posts
    172
    Vote Rating
    0
    Answers
    2
    Thierryg is on a distinguished road

      0  

    Default Unanswered: Architecture

    Unanswered: Architecture


    Hi,

    Before to implement something i have a question to ask abour my architecture.

    Indeed, i wanna know if i can declare an object for my titlebar :

    Code:
    var topbar = Ext.create('Ext.Panel',{
                        fullscreen: true,
                        styleHtmlContent: true,
                        items: [{
                            xtype: 'titlebar',
                            docked: 'top',
                            title: 'Panel title',
                            items: [{
                                xtype: 'button',
                                align: 'left',
                                iconCls: 'arrow_left',
                                iconMask: true,
                                ui: 'plain',
                                handler: function () {
                                    Ext.Msg.alert('You clicked the left button');
                                } // handler
                            }, {
                                xtype: 'button',
                                align: 'right',
                                iconCls: 'arrow_right',
                                iconMask: true,
                                ui: 'plain',
                                handler: function () {
                                    Ext.Msg.alert('You clicked the right button');
                                } // handler
                            }] // items
                        }, {
                            html: 'This is the body of the panel'
                        }] // items
                    });
    Then use it as item of all the several view of my navigation's view :

    Code:
    var _liveview = Ext.create('Ext.navigation.View',
            {
                fullscreen: true,
                items:
                [
                    {
                        title : _strings_live[dmngConfig.device.LanguageID],
                        layout: 'card',
                        id    : 'live_newliveprofile',
                        items :
                        [
    				    topbar,
                                        {
                                            xtype:      'textfield',
                                            id:         'live_newliveprofilename',
                                            name:       'live_newliveprofilename',
                                            label:      _strings_live_name[dmngConfig.device.LanguageID],
                                            labelAlign: 'left',
                                            labelWidth: '45%',
                                            value:      '',
                                            maxLength:  10,
                                            allowBlank: false
                                        },
    		    ]
                     }
    	    ]
    	});
    Thus, i can factorize the topbar for all views and make it unique.

    Is it possible ? can i inject the previous "topbar" object (previously defined) into the navigation's view as describe before ?

    Thanks in advance of your reply.

    Regards

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,599
    Vote Rating
    434
    Answers
    3102
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    You should make a new class for your topbar using Ext.define.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.