]>
git.proxmox.com Git - sencha-touch.git/blob - src/examples/forms_toolbar/app.js
8 * This is a simple demonstration of using form fields inside toolbar components.
11 // Define our application
13 // Setup your icon and startup screens
15 '320x460': 'resources/startup/Default.jpg', // Non-retina iPhone, iPod touch, and all Android devices
16 '640x920': 'resources/startup/640x920.png', // Retina iPhone and iPod touch
17 '640x1096': 'resources/startup/640x1096.png', // iPhone 5 and iPod touch (fifth generation)
18 '768x1004': 'resources/startup/768x1004.png', // Non-retina iPad (first and second generation) in portrait orientation
19 '748x1024': 'resources/startup/748x1024.png', // Non-retina iPad (first and second generation) in landscape orientation
20 '1536x2008': 'resources/startup/1536x2008.png', // : Retina iPad (third generation) in portrait orientation
21 '1496x2048': 'resources/startup/1496x2048.png' // : Retina iPad (third generation) in landscape orientation
24 isIconPrecomposed
: false,
26 57: 'resources/icons/icon.png',
27 72: 'resources/icons/icon@72.png',
28 114: 'resources/icons/icon@2x.png',
29 144: 'resources/icons/icon@144.png'
32 // Require any components we will use in our example
42 * The launch method is called when the browser is ready, and the application can launch.
44 * In this method we will create 3 fields: text, search and select. Will will insert each of these
45 * fields into a toolbar and display them in the Viewport.
48 var textField
, searchField
, selectField
;
50 // Create a text field with a name and palceholder
51 textField
= Ext
.create('Ext.field.Text', {
56 // Create a search field with a name and a placeholder
57 searchField
= Ext
.create('Ext.field.Search', {
62 // Create a select field with a name and some options
63 selectField
= Ext
.create('Ext.field.Select', {
66 { text
: 'Option 1 should be very very very long', value
: '1' },
67 { text
: 'Option 2', value
: '2' }
71 // Add a new item into the Viewport. This item will container our toolbars.
73 // Some html to explain the demo, and style the HTML
74 html
: 'This is a simple example of fields within toolbars.',
75 styleHtmlContent
: true,
77 // Give this container details for each of the items added. This means we don't have to
78 // set the xtype for each item.
83 // Add threee toolbars, each containing a field and a spacer at each side so the field is
87 // Dock the first toolbar at the top
96 // Dock the second toolbar at the top
106 // Dock the bottom toolbar at the top