-
Notifications
You must be signed in to change notification settings - Fork 2
/
local.html
74 lines (66 loc) · 1.95 KB
/
local.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<link href="http://extjs.cachefly.net/touch/sencha-touch-2.2.1/resources/css/sencha-touch.css" rel="stylesheet" type="text/css" />
<script src="http://extjs.cachefly.net/touch/sencha-touch-2.2.1/sencha-touch-all-debug.js" type="text/javascript"></script>
<script src="Ext.ux.AutoComplete.js" type="text/javascript" charset="utf-8"></script>
<title>Autocomplete for Sencha Touch 2</title>
</head>
<body>
<script type="text/javascript" charset="utf-8">
Ext.application({
launch: function () {
Ext.create('Ext.Container', {
fullscreen: true,
items: [
{
xtype: 'fieldset',
items: [
{
xtype: 'autocompletefield',
label: 'Stadt',
value: 'Ha',
config: {
resultsDisplay: {
qMinLength: 2,
itemTpl: '--> {city.name}, {county.name} - {state.name}',
itemTpl: '--> {city}, {county} - {state}',
emptyText: 'No results',
loadingText: 'Searching...',
mode: 'overlay',
overlayConfig: {
zIndex: 2,
width: '90%',
height: '90%',
inputPlaceHolder: 'Geben Sie hier den Städtenamen ein'
}
},
autoCompleteRequest: {
fields: [
'id', 'city', 'state', 'county'
],
requestType: 'local', // From local source
proxy: {
url: 'results.json',
reader: {
rootProperty: 'result'
},
filterField: 'city'
}
},
itemTapCallback : function(itemData) {
console.log(itemData);
alert('Selected: ' + itemData.city);
}
}
}
]
}
]
});
}
});
</script>
</body>
</html>