Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

vigiboard / vigiboard / public / js / Autocompleter / vigilo.js @ d8968a9a

History | View | Annotate | Download (543 Bytes)

1
Autocompleter.Request.VigiloJSON = new Class({
2

    
3
    Extends: Autocompleter.Request,
4

    
5
    options: {
6
        resVar: 'results'
7
    },
8

    
9
    initialize: function(el, url, options) {
10
        this.parent(el, options);
11
        this.request = new Request.JSON($merge({
12
            'url': url,
13
            'link': 'cancel',
14
        }, this.options.ajaxOptions)).addEvent('onComplete', this.queryResponse.bind(this));
15
    },
16

    
17
    queryResponse: function(response) {
18
        this.parent();
19
        this.update(response[this.options.resVar]);
20
    }
21

    
22
});