This is a migrated thread and some comments may be shown as answers.
ListBox - Double click item
2 Answers 53 Views
This is a migrated thread and some comments may be shown as answers.
Ben
Top achievements
Rank 1
Ben asked on 13 Aug 2018, 09:42 AM

Hello, 

I'm trying to get the dataTextField & dataValueField from double clicking on the ListBox. 

I feel like this should be easy but i cant find anything in the documentation or on google. 

 

So far i have this:

 

2 Answers, 1 is accepted

Sort by
0
Ben
Top achievements
Rank 1
answered on 13 Aug 2018, 09:43 AM

yeah so the forum decided to post my message without me finishing it?

 

So far i have:

   listBox.wrapper.find(".k-list").on("dblclick", ".k-item", function(e) {



    });

0
Preslav
Telerik team
answered on 14 Aug 2018, 11:01 AM
Hello Ben,

To achieve the desired result, in the dblclick event handler, get the ListBox widget, and use the e.target to get the dataItem.
For example:

$("#optional").data("kendoListBox").wrapper.find(".k-list").on("dblclick", ".k-item", function(e) {
var listBox = $(e.target).closest(".k-listbox").find("[data-role='listbox']").data("kendoListBox");
     var dataItem = listBox.dataItem(e.target);
   
  //...
});

For a runnable example, check this Dojo:
I hope this helps.


Regards,
Preslav
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Asked by
Ben
Top achievements
Rank 1
Answers by
Ben
Top achievements
Rank 1
Preslav
Telerik team
Share this question
or