This is a migrated thread and some comments may be shown as answers.

How to show hints in the dropdownlist popup

3 Answers 34 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Sylvain
Top achievements
Rank 1
Sylvain asked on 30 Jul 2015, 03:51 AM

I have a DropDownList with serverFiltering. I need a way to show hints to the user as he types. I'd like the hint to show right below the filter box. I have ​several use cases in mind:

  • Please type 5 more characters...
  • Showing 20 first matches or 12,000. Please refine criteria to get more relevant results.
  • No records match your criteria.

I there a way do that?

Thanks

3 Answers, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 03 Aug 2015, 06:46 AM

Hello Sylvain,

 

Straight to your questions: 

 

   1. In order to avoid sending a request to the server before user types the minimum number of characters you can set minLength property. In order to show hints you can bind the keypress event to the input field. 

 

    2 and 3.In order to achieve such behavior you can use the DropDownList dataBound event. To execute your custom logic only when the data source is filtered you can check whether there are any filters set using the filter method of the data source and get the filters. 

 

Regards,
Boyan Dimitrov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Sylvain
Top achievements
Rank 1
answered on 03 Aug 2015, 12:12 PM
Thanks for your answer but how do I put this hint inside the dropdown? I see that there is customizable header (headerTemplate) but how would I pass the data?
0
Boyan Dimitrov
Telerik team
answered on 05 Aug 2015, 12:41 PM

Hello Sylvain,

I would like to clarify that there is no way to send data to the header template. In order to achieve the desired behavior I would suggest using jQuery to manipulate the header template DOM element and show the hints.

 The header element has a class "dropdown-header", so it could be accessed by its class name and manipulated.

Regards,
Boyan Dimitrov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
DropDownList
Asked by
Sylvain
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Sylvain
Top achievements
Rank 1
Share this question
or