Skip to main content
grammar and syntax corrections; removed TIA, fluff
Source Link
battery.cord
  • 8.9k
  • 8
  • 32
  • 59

Just to make it easier to understand I will show you what I am doing.

Here is my component:

<aura:attribute name="showA" type="String" default="admin" /> 
<aura:attribute name="showB" type="String" default="help" /> 


<a href="#" data-show="{!v.showP}" onclick="{!c.show}" id="New">Link1<a/>
<a href="#" data-showQ="{!v.showQ}" onclick="{!c.show}"  id="Sent">Link2<a/>

Here is the controller NowNow, whenever a user will click I will get the value of op and op2, but what I want is to use a single attribute and change the value according to the link.

show: function(component,event,helper) {

    var op = event.currentTarget.dataset.show;

    var op2 = event.currentTarget.dataset.showQ; 

    alert(conole.log(op +':::::::::'+ op2));
}

thanks

Just to make it easier to understand I will show you what I am doing.

Here is my component

<aura:attribute name="showA" type="String" default="admin" /> 
<aura:attribute name="showB" type="String" default="help" /> 


<a href="#" data-show="{!v.showP}" onclick="{!c.show}" id="New">Link1<a/>
<a href="#" data-showQ="{!v.showQ}" onclick="{!c.show}"  id="Sent">Link2<a/>

Here is the controller Now, whenever a user will click I will get the value of op and op2, but what I want is to use a single attribute and change the value according to the link.

show: function(component,event,helper) {

    var op = event.currentTarget.dataset.show;

    var op2 = event.currentTarget.dataset.showQ; 

    alert(conole.log(op +':::::::::'+ op2));
}

thanks

Here is my component:

<aura:attribute name="showA" type="String" default="admin" /> 
<aura:attribute name="showB" type="String" default="help" /> 


<a href="#" data-show="{!v.showP}" onclick="{!c.show}" id="New">Link1<a/>
<a href="#" data-showQ="{!v.showQ}" onclick="{!c.show}"  id="Sent">Link2<a/>

Now, whenever a user will click I will get the value of op and op2, but what I want is to use a single attribute and change the value according to the link.

show: function(component,event,helper) {

    var op = event.currentTarget.dataset.show;

    var op2 = event.currentTarget.dataset.showQ; 

    alert(conole.log(op +':::::::::'+ op2));
}

Lightning component, controller function havingwith multiple parameterparameters

Just to make is more to easyit easier to understand, I will show you what I am doing.

Here is my component

<aura:attribute name="showA" type="String" default="admin" /> 
<aura:attribute name="showB" type="String" default="help" /> 


<a href="#" data-show="{!v.showP}" onclick="{!c.show}" id="New">Link1<a/>
<a href="#" data-showQ="{!v.showQ}" onclick="{!c.show}"  id="Sent">Link2<a/>

Here is the controller Now, whenever a user will click I will get the value of op and op2 accordingly now, but what I want is to use a single attribute and change the value according to the link.

show: function(component,event,helper) {

    var op = event.currentTarget.dataset.show;

    var op2 = event.currentTarget.dataset.showQ; 

    alert(conole.log(op +':::::::::'+ op2));
}

thanks

Lightning component, controller function having multiple parameter

Just to make is more to easy to understand, I will show what I am doing

Here is my component

<aura:attribute name="showA" type="String" default="admin" /> 
<aura:attribute name="showB" type="String" default="help" /> 


<a href="#" data-show="{!v.showP}" onclick="{!c.show}" id="New">Link1<a/>
<a href="#" data-showQ="{!v.showQ}" onclick="{!c.show}"  id="Sent">Link2<a/>

Here is the controller Now whenever user will click I will get the value of op and op2 accordingly now, but what I want is to use a single attribute and change the value according to the link.

show: function(component,event,helper) {

    var op = event.currentTarget.dataset.show;

    var op2 = event.currentTarget.dataset.showQ; 

    alert(conole.log(op +':::::::::'+ op2));
}

thanks

Lightning component, controller function with multiple parameters

Just to make it easier to understand I will show you what I am doing.

Here is my component

<aura:attribute name="showA" type="String" default="admin" /> 
<aura:attribute name="showB" type="String" default="help" /> 


<a href="#" data-show="{!v.showP}" onclick="{!c.show}" id="New">Link1<a/>
<a href="#" data-showQ="{!v.showQ}" onclick="{!c.show}"  id="Sent">Link2<a/>

Here is the controller Now, whenever a user will click I will get the value of op and op2, but what I want is to use a single attribute and change the value according to the link.

show: function(component,event,helper) {

    var op = event.currentTarget.dataset.show;

    var op2 = event.currentTarget.dataset.showQ; 

    alert(conole.log(op +':::::::::'+ op2));
}

thanks

Source Link

Lightning component, controller function having multiple parameter

Just to make is more to easy to understand, I will show what I am doing

Here is my component

<aura:attribute name="showA" type="String" default="admin" /> 
<aura:attribute name="showB" type="String" default="help" /> 


<a href="#" data-show="{!v.showP}" onclick="{!c.show}" id="New">Link1<a/>
<a href="#" data-showQ="{!v.showQ}" onclick="{!c.show}"  id="Sent">Link2<a/>

Here is the controller Now whenever user will click I will get the value of op and op2 accordingly now, but what I want is to use a single attribute and change the value according to the link.

show: function(component,event,helper) {

    var op = event.currentTarget.dataset.show;

    var op2 = event.currentTarget.dataset.showQ; 

    alert(conole.log(op +':::::::::'+ op2));
}

thanks