1. #1
    Sencha User
    Join Date
    Jan 2012
    Location
    Rennes - France
    Posts
    172
    Answers
    2
    Vote Rating
    1
    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
    Gainesville, FL
    Posts
    36,632
    Answers
    3452
    Vote Rating
    817
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    You should make a new class for your topbar using Ext.define.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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 in print!

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

Thread Participants: 1