-
9 Apr 2012 6:09 AM #1
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:
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?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("") } });
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!
-
Best Answer Posted by mitchellsimoens
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' } ] }
-
9 Apr 2012 6:20 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,710
- Vote Rating
- 436
- Answers
- 3113
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
________________
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.
-
9 Apr 2012 6:32 AM #3
Thanks for the response!
I kept trying the model in the docs without success, until I realized I was missing a comma...


Reply With Quote