examples/form/combocheck.js
[roojs1] / examples / form / combocheck.js
1 /*
2  * 
3  * (C) Alan Knowles 2011
4  * Licence : Roojs - LGPL
5  */
6  
7 var mform;
8 var combo
9 Roo.onReady(function(){
10
11     Roo.QuickTips.init();
12
13  
14     /*
15      * ================  Form 2  =======================
16      */
17     mform = Roo.factory({
18         xns : Roo.form,
19         xtype : 'Form',
20         labelAlign: 'top',
21         items : [
22             {
23                 xtype : 'ComboCheck',
24                 xns: Roo.form,
25                 
26                 name : 'states_list',
27                 fieldLabel: 'State',
28                 hiddenName:'states',
29                 valueField : 'abbr',
30                 displayField:'state',
31                 store: {
32                     xns : Roo.data,
33                     xtype : 'SimpleStore',
34                     fields: ['abbr', 'state'],
35                     data : Roo.exampledata.states // from states.js
36                    
37                 },
38                 
39                 typeAhead: true,
40                 mode: 'local',
41                 triggerAction: 'all',
42                 emptyText:'Select a state...',
43                 selectOnFocus:true,
44                 width:190
45           }
46
47             
48         ]
49         
50     });
51
52     mform.render('form-ct5');
53     combo = mform.findField('states_list');
54 });