-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
69 lines (61 loc) · 1.91 KB
/
index.html
File metadata and controls
69 lines (61 loc) · 1.91 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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title id="page-title">Autocomplete Tribute</title>
<link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css">
<script type="text/javascript" src="extjs/ext-all.js"></script>
</head>
<script type="text/javascript">
Ext.onReady(function() {
Ext.define('Ubuntu', {
extend: 'Ext.data.Model',
fields: [{
name: 'release',
convert: function(v, rec) {
return Ext.String.format('{0} {1} - {2}',
rec.raw.adjective, rec.raw.animal, rec.raw.version);
}
}]
});
Ext.create('Ext.panel.Panel', {
renderTo: Ext.getBody(),
title: 'Ubuntu Releases',
width: 300,
bodyPadding: 10,
layout: 'anchor',
draggable: true,
style: 'margin: 20px',
items: [{
xtype: 'combo',
store: Ext.create('Ext.data.Store', {
model: 'Ubuntu',
proxy: {
type: 'ajax',
url: '/backend/autocomplete',
reader: {
type: 'json',
root: 'data'
}
}
}),
typeAhead: true,
displayField: 'release',
hideLabel: true,
anchor: '100%',
minChars: 3,
listConfig: {
loadingText: 'Searching...',
emptyText: 'No matching release found'
}
}, {
xtype: 'component',
style: 'margin-top:10px',
html: 'Type at least 3 characters to trigger search'
}]
});
});
</script>
<body>
</body>
</html>