1. #1
    Sencha User stat30fbliss's Avatar
    Join Date
    Jun 2011
    Location
    Chicago, IL
    Posts
    4
    Vote Rating
    0
    stat30fbliss is on a distinguished road

      0  

    Default Answered: Working with MVC

    Answered: Working with MVC


    Hey there,

    I have finished the getting started App in the docs built with MVC. I have everything up and running great so I would like to take the demo app to the next level, and start customizing it to my needs.

    I am looking into different components and layout types, and am curious how I go about entering my new xtypes into my Views when working with MVC.

    My current Home view looks like this:

    Code:
    Ext.define('GS.view.Home', {
        extend: 'Ext.Panel',
        xtype: 'homepanel',
    
    
        config: {
            title: 'Home',
            iconCls: 'home',
            cls: 'home',
            scrollable: true,
            styleHtmlContent: true,
    
    
            html: [
                '<img src="http://staging.sencha.com/img/sencha.png" />',
                '<h1>Welcome to Sencha Touch</h1>',
                "<p>You're creating the Getting Started app. This demonstrates how ",
                "to use tabs, lists and forms to create a simple app</p>",
                '<h2>Sencha Touch (2.0.0)</h2>'
            ].join("")
        }
    });
    Now my question being, can I insert addition items [] within the config {} portion of the view, or do I need to add them elsewhere? Would I define those xtypes and their parameters inside the items[] string?

    I am looking to add in a different layout and just start placing a bunch of buttons with actions inside the homeview so I can start to get comfortable working with the components and layouts.

    I'm a noob, so be gentle

    Cheers!

  2. To add items to a parent then yes you can use the items config within the config object.

    Code:
    config : {
    ....
        items : [
            {
                xtype : 'button',
                text : 'Foo'
            }
        ]
    }

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


    To add items to a parent then yes you can use the items config within the config object.

    Code:
    config : {
    ....
        items : [
            {
                xtype : 'button',
                text : 'Foo'
            }
        ]
    }
    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 stat30fbliss's Avatar
    Join Date
    Jun 2011
    Location
    Chicago, IL
    Posts
    4
    Vote Rating
    0
    stat30fbliss is on a distinguished road

      0  

    Default


    Thanks for the response!

    I kept trying the model in the docs without success, until I realized I was missing a comma...

Thread Participants: 1

Tags for this Thread