Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Autocomplete Kendo Control I don't want to show "No Data found" when no matching records

I have a autocomplete kendo control which I use with Angular, its working as expected but I don't want to show the "NO DATA FOUND" list when there are no records match the text that the user enter.

I find the option k-no-data-template but this set the template in case no data was found.

Basically I want to show the list only if there are match results.

like image 915
mbadeveloper Avatar asked Dec 01 '16 16:12

mbadeveloper


People also ask

How do I get the selected value from Kendo AutoComplete?

You can just use var value = $("#Ac_Transporteur"). val(); to get the entered value in the Autocomplete field.

What is a kendo AutoComplete?

The Kendo UI for Angular AutoComplete is a form component that provides suggestions depending on the typed text. It is a richer version of the <input> element and supports data binding, filtering, and templates.


1 Answers

You can try this:

noDataTemplate: ''

for example

$("#autocomplete").kendoAutoComplete({
   dataSource: [
     { id: 1, city: "Bangalore" },
     { id: 2, city: "Pune" }
  ],
  dataTextField: "city",
  noDataTemplate: ''
});

So here, No Data found message won't come and even if you want to customize it put then:

noDataTemplate: 'customized message'  // if you want to show your custom message to user

Hope it work for you.

like image 67
Avnesh Shakya Avatar answered Oct 15 '22 06:10

Avnesh Shakya