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

How to dynamically do a 'search' on a dropdownlist in grid

3 Answers 430 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nathan
Top achievements
Rank 1
Nathan asked on 13 Apr 2016, 08:48 PM

I have a requirement that I need to be able to "paste" a value (via key event) into a grid cell that contains a dropdown list. Then I need to do a lookup for that value in the display text of the list (the "search" function I believe) and set the dropdown list accordingly.

I have trapped the keydown event for ctrl-v and have found the currentCell. I am trying to do something like this:

    var dropDownList = currentCell$.find("input").data("kendoDropDownList");

   dropdownList.search("K2");

However, this does not seem to work. It seems like the search function only works if the dropdown list is actually open rather than just the cell being selected. Not sure what I am missing. Also tried adding grid.editCell(currentCell) before it without much luck.

Can you tell me where I am going wrong?

 

3 Answers, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 15 Apr 2016, 03:12 PM

Hello Nathan,

I am afraid that the issue is not a known one, nor is reproducible in our online demos, so please extract a runnable sample in a Kendo UI Dojohttp://dojo.telerik.com/ and we will be happy to help.

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
Nathan
Top achievements
Rank 1
answered on 15 Apr 2016, 05:04 PM
My dojo link is below. You can see what I am talking about by clicking on the first row’s color (Black) and press ctrl-v. The description turns blank. If you then click open the dropdown list and press ctrl-v again, it finds “Orange” as expected.

http://dojo.telerik.com/AnixA
0
Boyan Dimitrov
Telerik team
answered on 19 Apr 2016, 02:14 PM

Hello Nathan,

Indeed in order search method to work the DropDownList should be opened first. A possible solution would be to open and then search for the text as shown in the http://dojo.telerik.com/AnixA/4. Alternative solution is to iterate manually through the data for the DropDownList and see which value is associated with the text and use the value method in order to set the value of the widget. 

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
Grid
Asked by
Nathan
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Nathan
Top achievements
Rank 1
Share this question
or