At the end of the article, let's go back and add a contact table. Our last tab contains a frompanel and a fieldset:
// We 've added a third and final item to our tab panel-scroll down to see it
Ext. Application ({
Name: 'sencha ',
Launch :(){
Ext. Create ("Ext. tabpanel ",{
Fullscreen: True,
Tabbarposition: 'bottom ',
Items :[
{
Title: 'home ',
Iconcls: 'home ',
CLS: 'home ',
HTML :[
' ',
'<H1> welcome to sencha touch
"<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.0pr1) </H2>'
]. Join ("")
},
{
Xtype: 'LIST ',
Title: 'blog ',
Iconcls: 'star ',
Itemtpl: '{Title }',
Store :{
Fields: ['title', 'url'],
Data :[
{Title: 'ext scheduler 100', URL: 'ext-scheduler-2-0-upgrading-to-ext-js-4 '},
{Title: 'previewing sencha touch 2', URL: 'sencha-touch-2-what-to-know CT '},
{Title: 'sencha con 2011 ', URL: 'senchacon-2011-now-packed-with-more-goodness '},
{Title: 'documentation in ext JS 4', URL: 'New-ext-js-4-documentation-center '}
]
}
},
// This is the new item
{
Title: 'Contact ',
Iconcls: 'user ',
Xtype: 'formpanel ',
URL: 'Contact. php ',
Layout: 'vbox ',
Items :[
{
Xtype: 'fieldset ',
Title: 'Contact us ',
Instructions: '(email address is optional )',
Items :[
{
Xtype: 'textfield ',
},
{
Xtype: 'emailfield ',
Label: 'email'
},
{
Xtype: 'texteafield ',
Label: 'message'
}
]
},
{
Xtype: 'button ',
Text: 'send ',
Ui: 'Confirm ',
Handler :(){
This. Up ('formpanel '). Submit ();
}
}
]
}
]
}). Setactiveitem (2 );
}
});
In the third tab, we added a table containing three fields and a submit button. On this page, we use the vbox layout to locate the submit button below. Fieldset itself is configured with a title and some instructions (prompt information ). Prompt. Finally, we use textfield, emailfield, and textareafield.
For the example source code of this entry-level article, you can find it in the examples/getting_started file directory of the sencha touch 2.0 SDK downloaded.
More references
So far, we have completed a very basic application instance, and it is time to further explore other content of the framework. Here, we have selected some development guides and component instances for you to learn. With the development of the beta version, we will also introduce more guidelines to build larger applications.