roojs-all.js
[roojs1] / examples / form / combos.js
1 /*
2  * Based on:
3  * Ext JS Library 1.1.1
4  * Copyright(c) 2006-2007, Ext JS, LLC.
5  *
6  * Originally Released Under LGPL - original licence link has changed is not relivant.
7  *
8  * Fork - LGPL
9  * <script type="text/javascript">
10  */
11
12 var combo = false;\r
13 Roo.onReady(function(){
14     // simple array store
15     var store = new Roo.data.SimpleStore({
16         fields: ['abbr', 'state'],
17         data : Roo.exampledata.states // from states.js
18     });
19     combo = new Roo.form.ComboBox({
20         store: store,
21         editable : false,
22         displayField:'state',
23         typeAhead: false,
24         mode: 'local',
25         triggerAction: 'all',
26         emptyText:'Select a state...',
27         selectOnFocus:true,
28         resizable:true
29     });
30     combo.applyTo('local-states');
31
32
33
34     var converted = new Roo.form.ComboBox({
35         typeAhead: true,
36         triggerAction: 'all',
37         transform:'state',
38         width:135,
39         forceSelection:true
40     });
41 });