Select2 Ajax not filtering results based on query

前端 未结 2 638
执念已碎
执念已碎 2020-12-17 18:40

I am new to Select2 and am having trouble integrating AJAX. When I search, the results aren\'t being filtered based on the query.

Here\'s how it looks: http://i.imgu

2条回答
  •  情歌与酒
    2020-12-17 19:08

    This question was asked on the github project and the answer was: filter on the server side. The default filter function called when AJAX is not used is present in the Select2 documentation on the matcher parameter:

    function(term, text) { return text.toUpperCase().indexOf(term.toUpperCase())>=0; }
    

提交回复
热议问题