1
votes

How to disable filtering in kendo autocomplete UI? I am getting 5 records on search but only matching records are shown in autocomplete popup even though I haven't used filters.

scope.autocompleteOptions = {
        dataTextField: 'description',
        minLength:1,
        dataSource:{
          data: locationsData, 
          group:'provider',
          serverFiltering:false
        },
        template: kendo.template($('#roc-map-places-template').html())
    }

Any ideas?

Thanks in advance.

2
Thanks @SanyamiVaidya , But my question is about kendo ui autocomplete. I am unable to disable filtering in kendo autocomplete. - Kiran Pawar
What filtering are you referring to? - Shai
I was not referring to server filtering here. I have already disabled it by doing serverFiltering: false. My concern was to disable all type of filtering. I have read in documentation that filter: 'startswith' is default filtering for kendo autocomplete UI and i have to disable it. - Kiran Pawar

2 Answers

0
votes

I could clear filters in kendo ui autocomplete as follows :

var autocomplete=$('#autocomplete').data('kendoAutoComplete');
autocomplete.dataSource.filter([]);

This will just clear filters.

This would not disable filters but clears it.

0
votes

Late reply - but I just needed the same ability -

Solution: Use the "filtering" event Example: see https://docs.telerik.com/kendo-ui/api/javascript/ui/autocomplete/events/filtering

<input id="autocomplete" />
<script>
$("#autocomplete").kendoAutoComplete({
  dataSource: [ "Apples", "Oranges" ],
  filtering: function(e) {
      var filter = e.filter;

      if (!filter.value) {
        //prevent filtering if the filter does not value
        e.preventDefault();
      }
  }
});
</script>