0

ListBox.cmp

<div id="div1" >
<label for="picklist">Available Labels</label> <br/>
 <select style="width:100%" id="picklist"  multiple="multiple" ondblclick="myFunction()">
   <aura:iteration items="{!v.GenreList}" var="opts">
       <option  value="{!opts}"> {!opts.value} </option>
   </aura:iteration>     
 </select> 
</div>

ListBox.controller

myFunction: function(component, event, helper){
    alert("hi");
   var a= event.get("{!opts}");
    alert(a);

}

when i double click on any options control is not going inside myFunction.

1
  • click handler on select tag should call function as ondblclick={!c.myFunction}"
    – Raul
    Jan 3, 2019 at 9:11

1 Answer 1

1

Double click handler on select tag should call client side controller function as ondblclick={!c.myFunction}".

Read more in Lightning Components Developer Guide: Handling Events with Client-Side Controllers

2
  • yes correct.now its working Jan 3, 2019 at 9:20
  • @Rahul..I want to fetch double click option value in myFunction() method in controller.how to get it. Jan 3, 2019 at 9:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .