Ajax Autocomplete for Jquery : How To Send Dynamic Parameters

前端 未结 6 1283
感情败类
感情败类 2021-01-17 22:03

i am using Ajax Autocomplete for Jquery ( http://www.devbridge.com/projects/autocomplete/jquery/ ) in one of my application. The Search Form looks something lik

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-17 22:46

    Alternatively, you can specify the params using a function which is evaluated just before the ajax request is sent.

    $('#q').autocomplete({
        ...
        params: {
            'entity_type': function() {
                return $('#top_search_select').val();
            }
        }
        ...
    });
    

提交回复
热议问题