vigiboard / vigiboard / public / js / autocompleter-vigilo.js @ db6fbc92
History | View | Annotate | Download (589 Bytes)
1 |
/**
|
---|---|
2 |
* Autocompleter.Request.VigiloJSON
|
3 |
*
|
4 |
*/
|
5 |
Autocompleter.Request.VigiloJSON = new Class({
|
6 |
|
7 |
Extends: Autocompleter.Request,
|
8 |
|
9 |
options: {
|
10 |
resVar: 'results' |
11 |
}, |
12 |
|
13 |
initialize: function(el, url, options) { |
14 |
this.parent(el, options);
|
15 |
this.request = new Request.JSON($merge({ |
16 |
'url': url,
|
17 |
'link': 'cancel' |
18 |
}, this.options.ajaxOptions)).addEvent('onComplete', this.queryResponse.bind(this)); |
19 |
}, |
20 |
|
21 |
queryResponse: function(response) { |
22 |
this.parent();
|
23 |
this.update(response[this.options.resVar]); |
24 |
} |
25 |
|
26 |
}); |