Default call (auto-completion)


Used to trigger auto-completion when input form is focused and there is no typed-in value (input is empty). This allows to display predefined list of suggestions to user.

Note It requires parameter (length=0).

Configuration options:

  • string - used to set as query to trigger auto-completion

  • [{value: '', label: ''}, {value: '', label: ''}] - list of hardcoded data to fulfill a dropdown menu

  • {data: [], filter: function(completion, data)} - use (filter function)[] to map a list of hardcoded data

  • {filter: function(completion, data), params: {}, url: ''} - use (filter function)[] to map data loaded from the server using a HTTP GET request by calling URL with given parameters


Display suggestions for query "funnelback"

defaultCall: 'funnelback'

Display fixed list of suggestions

defaultCall: [{value: "CSE", label:"CSE"}, {value: "Engineering", label:"Engineering"}]

Adjust fixed list of suggestions to required format and display it

defaultCall: {
    data: [{title: "CSE", url: ''}, {title: "Engineering", url: ''}],
    filter: function(item, data) {
        return, function(item, i) { return {value: item.title, label: item.title, extra: {action: item.url, action_t: 'U'}, rank: i + 1}; });

Request data from remote URL and display as list of suggestions

defaultCall: {
    filter: myCustomFunctionToMapData
    params: {},
    url: 'http://my-domain/custom-suggestions-list'