1. #1
    Sencha User
    Join Date
    Aug 2012
    Posts
    2
    Vote Rating
    0
    roozbubu is on a distinguished road

      0  

    Default Answered: Incredibly simple toolbar config question

    Answered: Incredibly simple toolbar config question


    I am building a test app with sencha touch 2.

    For some reason, I cannot add a tab panel as an item to a global container added to the viewport. My app.js file initializes the viewport, adds the 'Main.js' view to it. Here is the source code that works, slightly (see the bottom, sorry for horrid indenting).

        Ext.define('Test.view.Main',{
        extend: 'Ext.Container',
        requires: [
            'Test.view.Home',
            'Test.view.MyTabView'
        ],
        fullscreen: true,
        config: {


        items: [
            {
                xtype: 'mytabview'

            }

        ]
    }

    });
    This at least initializes the the tab view properly, which is stored in a seperate view file, Test.view.MyTabView. (source below)

    Ext.define('Test.view.MyTabView',{
        extend: 'Ext.TabPanel',
        fullscreen: true,
        xtype: 'mytabview',
        requires: 'Test.view.Home',
        config: {
            defaults: {
            styleHtmlContent: true
            },
            tabBarPosition: 'bottom',
            docked: 'bottom',
                items: [
                    {
                        xtype: 'homepanel'
                    }  
                ]
            }
    });
    But when i combine the two, inline, nothing works anymore. Of course i could and should keep it in a separate file for better organization, but it is important to my understanding of the framework itself as to why this isnt working. (source below).

    Ext.define('Test.view.Main',{
        extend: 'Ext.Container',
        requires: [
            'Test.view.Home',
            'Test.view.MyTabView'
        ],
        fullscreen: true,
        config: {


        items: [
            {
               fullscreen: true,
                xtype: 'mytabview',
                requires: 'Test.view.Home',
                config: {
                    defaults: {
                    styleHtmlContent: true
                    },
                    tabBarPosition: 'bottom',
                    docked: 'bottom',
                        items: [
                            {
                                xtype: 'homepanel'
                            }  
                        ]
                    }

            }

        ]
    }
    });
    NOTE: Neither of these implementations also correctly render the HTML inside the provided tab objects into the viewport. homepanel is an xtype of a Panel defined in Test.view.Home, but even defining an inline panel doesnt work.

    javascript sencha sencha-touch-2 javascript-objects

  2. Something more like this:

    Code:
    Ext.define('Test.view.Main', {
        extend     : 'Ext.Container',
        requires   : [
            'Test.view.Home',
            'Test.view.MyTabView'
        ],
        config     : {
            layout : 'fit',
            items  : [
                {
                    xtype          : 'mytabview',
                    defaults       : {
                        styleHtmlContent : true
                    },
                    tabBarPosition : 'bottom',
                    items          : [
                        {
                            xtype : 'homepanel'
                        }
                    ]
                }
            ]
        }
    });
    Although looking at this class, it's overnesting. Since Test.view.Main only has a single item (the mytabview) you then don't need the Test.view.Main class.

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,756
    Answers
    3462
    Vote Rating
    828
    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


    2 things, remove the fullscreen configs. Also, child items shouldn't use the config object, have the configs outside of the config object for the mytabview item config (also remove the requires property)
    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.

  4. #3
    Sencha User
    Join Date
    Aug 2012
    Posts
    2
    Vote Rating
    0
    roozbubu is on a distinguished road

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    2 things, remove the fullscreen configs. Also, child items shouldn't use the config object, have the configs outside of the config object for the mytabview item config (also remove the requires property)
    I'm sorry, but could you please provide an example? I did what you said but unfortunately could not get it working.

  5. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,756
    Answers
    3462
    Vote Rating
    828
    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

      1  

    Default


    Something more like this:

    Code:
    Ext.define('Test.view.Main', {
        extend     : 'Ext.Container',
        requires   : [
            'Test.view.Home',
            'Test.view.MyTabView'
        ],
        config     : {
            layout : 'fit',
            items  : [
                {
                    xtype          : 'mytabview',
                    defaults       : {
                        styleHtmlContent : true
                    },
                    tabBarPosition : 'bottom',
                    items          : [
                        {
                            xtype : 'homepanel'
                        }
                    ]
                }
            ]
        }
    });
    Although looking at this class, it's overnesting. Since Test.view.Main only has a single item (the mytabview) you then don't need the Test.view.Main class.
    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

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi