combos_wev8.js
2.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
* Ext JS Library 2.0.2
* Copyright(c) 2006-2008, Ext JS, LLC.
* licensing@extjs.com
*
* http://extjs.com/license
*/
Ext.onReady(function(){
Ext.QuickTips.init();
// simple array store
var store = new Ext.data.SimpleStore({
fields: ['abbr', 'state', 'nick'],
data : Ext.exampledata.states // from states.js
});
var combo = new Ext.form.ComboBox({
store: store,
displayField:'state',
typeAhead: true,
mode: 'local',
triggerAction: 'all',
emptyText:'Select a state...',
selectOnFocus:true,
applyTo: 'local-states'
});
var comboWithTooltip = new Ext.form.ComboBox({
tpl: '<tpl for="."><div ext:qtip="{state}. {nick}" class="x-combo-list-item">{state}</div></tpl>',
store: store,
displayField:'state',
typeAhead: true,
mode: 'local',
triggerAction: 'all',
emptyText:'Select a state...',
selectOnFocus:true,
applyTo: 'local-states-with-qtip'
});
var converted = new Ext.form.ComboBox({
typeAhead: true,
triggerAction: 'all',
transform:'state',
width:135,
forceSelection:true
});
// Create code view Panels. Ignore.
new Ext.Panel({
contentEl: 'state-combo-code',
width: Ext.getBody().child('p').getWidth(),
title: 'View code to create this combo',
hideCollapseTool: true,
titleCollapse: true,
collapsible: true,
collapsed: true,
renderTo: 'state-combo-code-panel'
});
new Ext.Panel({
contentEl: 'state-combo-qtip-code',
autoScroll: true,
width: Ext.getBody().child('p').getWidth(),
title: 'View code to create this combo',
hideCollapseTool: true,
titleCollapse: true,
collapsible: true,
collapsed: true,
renderTo: 'state-combo-qtip-code-panel'
});
new Ext.Panel({
contentEl: 'transformed-combo-code',
autoScroll: true,
width: Ext.getBody().child('p').getWidth(),
title: 'View code to create this combo',
hideCollapseTool: true,
titleCollapse: true,
collapsible: true,
collapsed: true,
renderTo: 'transformed-combo-code-panel'
});
});