Upgrade to ExtJS 3.1.0 - Released 12/16/2009
[extjs.git] / examples / test-case-2b / resources / form-configs.js
1 /*!
2  * Ext JS Library 3.1.0
3  * Copyright(c) 2006-2009 Ext JS, LLC
4  * licensing@extjs.com
5  * http://www.extjs.com/license
6  */
7 /*!
8  * Ext JS Library 3.1.0
9  * Copyright(c) 2006-2009 Ext JS, LLC
10  * licensing@extjs.com
11  * http://www.extjs.com/license
12  */
13 /*!
14  * Ext JS Library 3.1.0
15  * Copyright(c) 2006-2009 Ext JS, LLC
16  * licensing@extjs.com
17  * http://www.extjs.com/license
18  */
19 /*!
20  * Ext JS Library 3.1.0
21  * Copyright(c) 2006-2009 Ext JS, LLC
22  * licensing@extjs.com
23  * http://www.extjs.com/license
24  */
25 /*!
26  * Ext JS Library 3.1.0
27  * Copyright(c) 2006-2009 Ext JS, LLC
28  * licensing@extjs.com
29  * http://www.extjs.com/license
30  */
31 /*!
32  * Ext JS Library 3.1.0
33  * Copyright(c) 2006-2009 Ext JS, LLC
34  * licensing@extjs.com
35  * http://www.extjs.com/license
36  */
37 /*!
38  * Ext JS Library 3.1.0
39  * Copyright(c) 2006-2009 Ext JS, LLC
40  * licensing@extjs.com
41  * http://www.extjs.com/license
42  */
43 /*!
44  * Ext JS Library 3.1.0
45  * Copyright(c) 2006-2009 Ext JS, LLC
46  * licensing@extjs.com
47  * http://www.extjs.com/license
48  */
49 /*!
50  * Ext JS Library 3.1.0
51  * Copyright(c) 2006-2009 Ext JS, LLC
52  * licensing@extjs.com
53  * http://www.extjs.com/license
54  */
55 /*!
56  * Ext JS Library 3.1.0
57  * Copyright(c) 2006-2009 Ext JS, LLC
58  * licensing@extjs.com
59  * http://www.extjs.com/license
60  */
61 /*!
62  * Ext JS Library 3.1.0
63  * Copyright(c) 2006-2009 Ext JS, LLC
64  * licensing@extjs.com
65  * http://www.extjs.com/license
66  */
67 /*!
68  * Ext JS Library 3.1.0
69  * Copyright(c) 2006-2009 Ext JS, LLC
70  * licensing@extjs.com
71  * http://www.extjs.com/license
72  */
73 /*!
74  * Ext JS Library 3.1.0
75  * Copyright(c) 2006-2009 Ext JS, LLC
76  * licensing@extjs.com
77  * http://www.extjs.com/license
78  */
79 /*!
80  * Ext JS Library 3.1.0
81  * Copyright(c) 2006-2009 Ext JS, LLC
82  * licensing@extjs.com
83  * http://www.extjs.com/license
84  */
85 /*!
86  * Ext JS Library 3.1.0
87  * Copyright(c) 2006-2009 Ext JS, LLC
88  * licensing@extjs.com
89  * http://www.extjs.com/license
90  */
91 /*!
92  * Ext JS Library 3.1.0
93  * Copyright(c) 2006-2009 Ext JS, LLC
94  * licensing@extjs.com
95  * http://www.extjs.com/license
96  */
97 /*!
98  * Ext JS Library 3.1.0
99  * Copyright(c) 2006-2009 Ext JS, LLC
100  * licensing@extjs.com
101  * http://www.extjs.com/license
102  */
103 /*!
104  * Ext JS Library 3.1.0
105  * Copyright(c) 2006-2009 Ext JS, LLC
106  * licensing@extjs.com
107  * http://www.extjs.com/license
108  */
109 /*!
110  * Ext JS Library 3.1.0
111  * Copyright(c) 2006-2009 Ext JS, LLC
112  * licensing@extjs.com
113  * http://www.extjs.com/license
114  */
115 /*!
116  * Ext JS Library 3.1.0
117  * Copyright(c) 2006-2009 Ext JS, LLC
118  * licensing@extjs.com
119  * http://www.extjs.com/license
120  */
121 /*!
122  * Ext JS Library 3.1.0
123  * Copyright(c) 2006-2009 Ext JS, LLC
124  * licensing@extjs.com
125  * http://www.extjs.com/license
126  */
127 /*!
128  * Ext JS Library 3.1.0
129  * Copyright(c) 2006-2009 Ext JS, LLC
130  * licensing@extjs.com
131  * http://www.extjs.com/license
132  */
133 /*!
134  * Ext JS Library 3.1.0
135  * Copyright(c) 2006-2009 Ext JS, LLC
136  * licensing@extjs.com
137  * http://www.extjs.com/license
138  */
139 /*!
140  * Ext JS Library 3.1.0
141  * Copyright(c) 2006-2009 Ext JS, LLC
142  * licensing@extjs.com
143  * http://www.extjs.com/license
144  */
145 /*!
146  * Ext JS Library 3.1.0
147  * Copyright(c) 2006-2009 Ext JS, LLC
148  * licensing@extjs.com
149  * http://www.extjs.com/license
150  */
151 /*!
152  * Ext JS Library 3.1.0
153  * Copyright(c) 2006-2009 Ext JS, LLC
154  * licensing@extjs.com
155  * http://www.extjs.com/license
156  */
157 /*!
158  * Ext JS Library 3.1.0
159  * Copyright(c) 2006-2009 Ext JS, LLC
160  * licensing@extjs.com
161  * http://www.extjs.com/license
162  */
163 /*!
164  * Ext JS Library 3.1.0
165  * Copyright(c) 2006-2009 Ext JS, LLC
166  * licensing@extjs.com
167  * http://www.extjs.com/license
168  */
169 /*!
170  * Ext JS Library 3.1.0
171  * Copyright(c) 2006-2009 Ext JS, LLC
172  * licensing@extjs.com
173  * http://www.extjs.com/license
174  */
175 /*!
176  * Ext JS Library 3.1.0
177  * Copyright(c) 2006-2009 Ext JS, LLC
178  * licensing@extjs.com
179  * http://www.extjs.com/license
180  */
181 /*!
182  * Ext JS Library 3.1.0
183  * Copyright(c) 2006-2009 Ext JS, LLC
184  * licensing@extjs.com
185  * http://www.extjs.com/license
186  */
187 /*!
188  * Ext JS Library 3.1.0
189  * Copyright(c) 2006-2009 Ext JS, LLC
190  * licensing@extjs.com
191  * http://www.extjs.com/license
192  */
193 /*!
194  * Ext JS Library 3.1.0
195  * Copyright(c) 2006-2009 Ext JS, LLC
196  * licensing@extjs.com
197  * http://www.extjs.com/license
198  */
199 /*!
200  * Ext JS Library 3.1.0
201  * Copyright(c) 2006-2009 Ext JS, LLC
202  * licensing@extjs.com
203  * http://www.extjs.com/license
204  */
205 /*!
206  * Ext JS Library 3.1.0
207  * Copyright(c) 2006-2009 Ext JS, LLC
208  * licensing@extjs.com
209  * http://www.extjs.com/license
210  */
211 /*!
212  * Ext JS Library 3.1.0
213  * Copyright(c) 2006-2009 Ext JS, LLC
214  * licensing@extjs.com
215  * http://www.extjs.com/license
216  */
217 /*!
218  * Ext JS Library 3.1.0
219  * Copyright(c) 2006-2009 Ext JS, LLC
220  * licensing@extjs.com
221  * http://www.extjs.com/license
222  */
223 /*!
224  * Ext JS Library 3.1.0
225  * Copyright(c) 2006-2009 Ext JS, LLC
226  * licensing@extjs.com
227  * http://www.extjs.com/license
228  */
229
230 //var doLayout = Ext.Container.prototype.doLayout;
231 // Ext.override(Ext.Container, {
232 //     doLayout: function() {
233 //         doLayout.apply(this, arguments);
234 //         console.log(this.id, this.ownerCt && this.ownerCt.id, this.ownerCt && this.ownerCt.items.getCount());
235 //     }
236 // })
237
238
239 // For forms, use xtype: 'panel', layout: 'form'.
240 // IE 6 is not always able to free the form tag element
241 // if using xtype: 'form'.
242
243 // There are 2 form configs -- will use (mod 2) to pick one.
244
245 var formConfigs = [{
246    //
247    // -- form config 1
248    //
249    xtype: 'form',
250    labelWidth: 75,
251    url: 'save-form.php',
252    frame: true,
253    baseCls: 'x-bubble',
254    width: 680,
255    autoHeight: true,
256    bodyStyle: { 'padding': '5px 7px 0px 7px' },
257    items: [{
258       xtype: 'fieldset',
259       collapsible: true,
260       title: 'User Information',
261       autoHeight: true,
262       autoWidth: true,
263       defaultType: 'textfield',
264       collapsed: true,
265       items :[{
266          fieldLabel: 'First Name',
267          name: 'first',
268          allowBlank: false
269       },{
270          fieldLabel: 'Last Name',
271          name: 'last'
272       },{
273          fieldLabel: 'Company',
274          name: 'company'
275       }, {
276          fieldLabel: 'Email',
277          name: 'email',
278          vtype: 'email'
279       }]
280    },{
281       xtype:'fieldset',
282       title: 'Phone Number',
283       collapsible: true,
284       autoHeight: true,
285       autoWidth: true,
286       defaultType: 'textfield',
287       items :[{
288          fieldLabel: 'Home',
289          name: 'home',
290          value: '(888) 555-1212'
291       },{
292          fieldLabel: 'Business',
293          name: 'business'
294       },{
295          fieldLabel: 'Mobile',
296          name: 'mobile'
297       },{
298          fieldLabel: 'Fax',
299          name: 'fax'
300       }]
301    },{
302       xtype: 'panel',
303       unstyled: true,
304       buttonAlign: 'center',
305       buttons: [{
306          text: 'Save',
307          scale: 'medium',
308          scope: this
309       },{
310          text: 'Cancel',
311          scale: 'medium',
312          scope: this
313       }]
314    }]
315 },{
316    //
317    // -- form config 2
318    //
319    xtype: 'panel',
320    frame: true,
321    baseCls: 'x-bubble',
322    border: false,
323    width: 680,
324    autoHeight: true,
325    bodyStyle: { 'padding': '5px 7px 0px 7px' },
326   
327    items: [{ 
328       layout: 'column',
329       border: false,
330       autoHeight: true,
331       autoWidth: true,
332       bodyStyle: 'padding-bottom: 6px',
333       defaults: { layout: 'fit' },
334       items: [{
335          columnWidth: .5,
336          layout: 'form',
337          labelAlign: 'top',
338          border: false,
339          items: [{
340             xtype: 'textfield',
341             fieldLabel: 'First Name',
342             name: 'first',
343             anchor: '94%' 
344          }, { 
345             xtype: 'textfield',
346             fieldLabel: 'Company',
347             name: 'company',
348             anchor: '94%' 
349          }]   
350       },{     
351          columnWidth: .5,
352          layout: 'form',
353          labelAlign: 'top',
354          border: false,
355          items: [{
356             xtype: 'textfield',
357             fieldLabel: 'Last Name',
358             name: 'last',
359             anchor: '94%'
360          },{
361             xtype: 'textfield',
362             fieldLabel: 'Email',
363             name: 'email',
364             vtype: 'email',
365             anchor: '94%'
366          }]
367       }]
368    },{
369       xtype: 'tabpanel',
370       plain: true,
371       activeTab: 0,
372       height: 200,
373       bodyStyle: 'margin-bottom: 10px',
374       deferredRender: false,
375       defaults: {
376          autoWidth: true,
377          layout: 'fit',
378          bodyStyle: 'padding: 10px'
379       },
380       items:[{
381          title: 'Phone Numbers',
382          layout: 'form',
383          defaults: {width: 230},
384          defaultType: 'textfield',
385
386          items: [{
387             fieldLabel: 'Home',
388             name: 'home'
389          },{
390             fieldLabel: 'Business',
391             name: 'business',
392             value: '(888) 555-1212'
393          },{
394             fieldLabel: 'Mobile',
395             name: 'mobile'
396          },{
397             fieldLabel: 'Fax',
398             name: 'fax'
399          }]
400       },{
401          cls: 'x-plain',
402          title: 'Biography',
403          layout: 'fit',
404          bodyStyle: 'padding:8px',
405          items: {
406             xtype: 'htmleditor',
407             name: 'bio2',
408             fieldLabel: 'Biography'
409          }
410       }]
411    },{
412       xtype: 'panel',
413       unstyled: true,
414       buttonAlign: 'center',
415       buttons: [{
416          text: 'Save',
417          scale: 'medium',
418          scope: this
419       },{
420          text: 'Cancel',
421          scale: 'medium',
422          scope: this
423       }]
424    }]
425 }];
426