简体   繁体   中英

Adding “No data found” message on Kendo Autocomplete with AngularJS

I'm new to Kendo UI and I apologize if this is a simple question, but I am working on a site that has search functionality that uses AutoComplete to show possible results. But when there are no matches the list simply goes away, and I need there to be a message that says there are no more matches in place of that list.

I did not write the majority of this code, but all I can find associated with it is this in HTML:

input kendo-auto-complete style="width:100%" ng-model="vm.search" k- k-data-source="vm.searchList" />

I've checked the Kendo site and there seem to be options to help with my issue, but I don't know how to implement them with AngularJS involved.

Basically all options you can find on the KendoUI docs can be converted to be usable with AngularJS. ( Reference )

In your case the desired option is called noDataTemplate . To use this configuration in HTML you have to convert it from camelCase to be dash-seperated and prefix it with k- .

The result should look like this: k-no-data-template .

Complete sample in HTML:

<input kendo-auto-complete k-data-source="data" k-no-data-template="'No Data available!'" />

your can find the solution in this post:

Add new Item with AngularJS

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM