Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <aura:iteration items="{!v.selectedFilters}" var="filter" indexVar="filterIndex">
- <li class="slds-pill slds-m-right--xxx-small" >
- <a href="javascript:void(0);" class="slds-pill__label" title="Full pill label verbiage mirrored here">{!filter.displayValue}</a>
- <lightning:buttonIcon iconName="utility:close" alternativeText="close" variant="bare" onclick="{!c.resetFilter}" value="{!filterIndex}"/>
- </li>
- </aura:iteration>
- resetFilter : function(component,event,helper) {
- console.log(event.currentTarget);
- console.log(event.target);
- }
- <aura:component >
- <aura:attribute name="label" type="string"/>
- <aura:attribute name="value" type="object"/>
- <aura:registerEvent name="onclick" type="c:evtDOMEvent"/>
- <a href="javascript:void(0);" class="slds-pill__label" title="Full pill label verbiage mirrored here">{!v.label}</a>
- <lightning:buttonIcon iconName="utility:close" alternativeText="close" variant="bare" onclick="{!c.triggerOnClickEvent}"/>
- </aura:component>
- ({
- triggerOnClickEvent : function(component, event, helper) {
- component.getEvent("onclick").fire();
- }
- })
- <aura:iteration items="{!v.selectedFilters}" var="filter" indexVar="filterIndex">
- <li class="slds-pill slds-m-right--xxx-small" >
- <c:uiPill label="{!filter.displayValue}" onclick="{!c.resetFilter}" value="{!filterIndex}"/>
- </li>
- </aura:iteration>
- resetFilter : function(component,event,helper) {
- console.log(event.getSource().get("v.value"));
- },
- <lightning:button aura:id="button" variant="brand" label="Submit" onclick="{! c.getMyId }"/>
- getMyId : function(component, event, helper) {
- console.log(event.getSource().getLocalId());
- }
- <aura:component>
- <aura:attribute name="press" type="Aura.Action" access="global" description="JS controller action to perform when button pressed"/>
- <aura:attribute name="value" type="String" access="global" description="Button value"/>
- <button onclick="{!v.press}" value="{!v.value}">
- <!-- manage your styles here with some input parameters -->
- </button>
- </aura:component>
- <c:Button value="yourvaluehere" press="{!c.onPushTheButton}" />
- onPushTheButton : function(component, event, helper) {
- var Val = event.target.value;
- // You'll get 'yourvaluehere' in Val, do whatever u need with it :)
- }
- <aura:component>
- <aura:attribute name="press" type="Aura.Action" access="global" description="JS controller action to perform when button pressed"/>
- <aura:attribute name="value" type="String" access="global" description="Button value"/>
- <span onclick="{!v.press}" value="{!v.value}">
- {!v.body}
- </span>
- </aura:component>
- <c:Button value="yourvaluehere" press="{!c.onPushTheButton}">
- <p style="background-color:green;">MyButton,images,whatever u want</p>
- </c:Button>
- <lightning:button class="action-btns" value="yourValue" variant="neutral" label="something" onclick="{! c.handleAction }">
- handleAction : function(component, event, helper) {
- var btnValue = event.getSource().get("v.value");
- }
Add Comment
Please, Sign In to add comment