7021564ca52f19212789bc34f93b556e3b6b8bf4
[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 \r
12 Roo.onReady(function(){
13     // simple array store
14     var store = new Roo.data.SimpleStore({
15         fields: ['abbr', 'state'],
16         data : Roo.exampledata.states // from states.js
17     });
18     var combo = new Roo.form.ComboBox({
19         store: store,
20         editable : false,
21         displayField:'state',
22         typeAhead: true,
23         mode: 'local',
24         triggerAction: 'all',
25         emptyText:'Select a state...',
26         selectOnFocus:true,
27         resizable:true
28     });
29     combo.applyTo('local-states');
30
31
32
33     var converted = new Roo.form.ComboBox({
34         typeAhead: true,
35         triggerAction: 'all',
36         transform:'state',
37         width:135,
38         forceSelection:true
39     });
40 });