Skip to content

Conversation

@gedbac
Copy link
Member

@gedbac gedbac commented Feb 18, 2013

We need to add extra parameter to search criteria:

    $('#Origin_Value').autocomplete({
        serviceUrl: '/Rate/FindCity',
        deferRequestBy: 300,
        minChars: 3,
        maxHeight: 250,
        width: 161,
        zIndex: 9999,
        onSelect: onOriginChanged,
        onSearchStart: function (context) {
            context['countryId'] = 1;
        }
    });

We need to add extra parameter to search criteria
tkirda pushed a commit that referenced this pull request Feb 18, 2013
Parameters were passed to method 'onSearchStart'
@tkirda tkirda merged commit a439496 into devbridge:master Feb 18, 2013
@ghost
Copy link

ghost commented Aug 28, 2014

Seems broken, no? The original "q" param is "Dan" and I am trying to change it to "Al" but I instead get results for "Dan". What am I doing wrong here?

onSearchStart: function(query){
return $(this).autocomplete('setOptions', {params: {q: 'Al'}});
},

@tkirda
Copy link
Member

tkirda commented Aug 28, 2014

You are adding additional parameter here. Not overriding query. By the way, default key for parameter is query, not q.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants