Last active
October 1, 2019 08:24
-
-
Save srujan21/50df382f1e4ba993b6d4ae8582fea8d2 to your computer and use it in GitHub Desktop.
Set custom attribute on component and Retrieve that in controller
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="slds-truncate" style ="text-align : center;" title="{!$Label.c.Selection}" data-selected-Index = "{!com.key}" onclick ="{!c.setKey}"> | |
<lightning:input aura:id="selectedRange" name="radioButton" type="radio"/> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setKey: function(component, event,helper) { | |
var target = event.currentTarget; | |
var dataEle = event.currentTarget.getAttribute("data-selected-Index"); | |
console.log("v.selectedItem", "Component at index "+dataEle+" has value "+target.value); | |
component.set("v.commsListKey", dataEle); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment