1<aui:script use="aui-autocomplete">
2
3 var cities = [
4 ['AH', 'Ahmedabad', 'The Land of IIM'],
5 ['AM', 'Amritsar', 'City of golden Temple'],
6 ['BL', 'Bangalore', 'Silicon Valley of India'],
7 ['CA', 'Calcutta', 'City of Joy'],
8 ['DL', 'Delhi', 'Land of Hearts'],
9 ['JA', 'Jaipur', 'The Pink City'],
10 ['JP', 'Jodhpur', 'The Blue City'],
11 ['SU', 'surat', '.Diamond City']
12 ];
13
14 window.XXX = new A.AutoComplete(
15 {
16 dataSource: cities,
17 schema: {
18 resultFields: ['key', 'name', 'description']
19 },
20 matchKey: 'name',
21 delimChar: ',',
22 typeAhead: true,
23 contentBox: '#<portlet:namespace />drop-down-1'
24 }
25 );
26
27 XXX.formatResult = function(oResultData, sQuery, sResultMatch) {
28 var tmp = "" + this.overlay;
29 var node = document.getElementById(tmp.substring((tmp.indexOf("[") + 1), tmp.indexOf("]")));
30 alert(node.style.zIndex);
31 node.style.border = "5px solid black";
32
33 return (sResultMatch);
34 };
35 XXX.render();
36</aui:script>
Please sign in to flag this as inappropriate.