Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Navigating Salesforce Excellence
Navigating Salesforce Excellence
How to send two values/Id from Aura component to Javascript Controller
We might sometimes struggle to send data or mostly Id on an on-click event from Aura Component to the Javascript Controller class.
For this, follow the steps below:
<a data-category="{!iterator.value1}" data-id="{!iterator.value2}" onclick="{!c.action}"> </a>
2. Afterward, paste the following code in the JS controller:
action: function (component, event, helper) { let cat = event.target.getAttribute("data-category"); let id = event.target.getAttribute("data-id"); }