Guest User

Untitled

a guest
Dec 13th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.02 KB | None | 0 0
  1. <aura:iteration items="{!v.selectedFilters}" var="filter" indexVar="filterIndex">
  2. <li class="slds-pill slds-m-right--xxx-small" >
  3. <a href="javascript:void(0);" class="slds-pill__label" title="Full pill label verbiage mirrored here">{!filter.displayValue}</a>
  4. <lightning:buttonIcon iconName="utility:close" alternativeText="close" variant="bare" onclick="{!c.resetFilter}" value="{!filterIndex}"/>
  5. </li>
  6. </aura:iteration>
  7.  
  8. resetFilter : function(component,event,helper) {
  9. console.log(event.currentTarget);
  10. console.log(event.target);
  11. }
  12.  
  13. <aura:component >
  14. <aura:attribute name="label" type="string"/>
  15. <aura:attribute name="value" type="object"/>
  16. <aura:registerEvent name="onclick" type="c:evtDOMEvent"/>
  17.  
  18. <a href="javascript:void(0);" class="slds-pill__label" title="Full pill label verbiage mirrored here">{!v.label}</a>
  19. <lightning:buttonIcon iconName="utility:close" alternativeText="close" variant="bare" onclick="{!c.triggerOnClickEvent}"/>
  20. </aura:component>
  21.  
  22. ({
  23. triggerOnClickEvent : function(component, event, helper) {
  24. component.getEvent("onclick").fire();
  25. }
  26. })
  27.  
  28. <aura:iteration items="{!v.selectedFilters}" var="filter" indexVar="filterIndex">
  29. <li class="slds-pill slds-m-right--xxx-small" >
  30. <c:uiPill label="{!filter.displayValue}" onclick="{!c.resetFilter}" value="{!filterIndex}"/>
  31. </li>
  32. </aura:iteration>
  33.  
  34. resetFilter : function(component,event,helper) {
  35. console.log(event.getSource().get("v.value"));
  36. },
  37.  
  38. <lightning:button aura:id="button" variant="brand" label="Submit" onclick="{! c.getMyId }"/>
  39.  
  40. getMyId : function(component, event, helper) {
  41. console.log(event.getSource().getLocalId());
  42. }
  43.  
  44. <aura:component>
  45.  
  46. <aura:attribute name="press" type="Aura.Action" access="global" description="JS controller action to perform when button pressed"/>
  47. <aura:attribute name="value" type="String" access="global" description="Button value"/>
  48.  
  49. <button onclick="{!v.press}" value="{!v.value}">
  50. <!-- manage your styles here with some input parameters -->
  51. </button>
  52.  
  53. </aura:component>
  54.  
  55. <c:Button value="yourvaluehere" press="{!c.onPushTheButton}" />
  56.  
  57. onPushTheButton : function(component, event, helper) {
  58. var Val = event.target.value;
  59. // You'll get 'yourvaluehere' in Val, do whatever u need with it :)
  60. }
  61.  
  62. <aura:component>
  63.  
  64. <aura:attribute name="press" type="Aura.Action" access="global" description="JS controller action to perform when button pressed"/>
  65. <aura:attribute name="value" type="String" access="global" description="Button value"/>
  66.  
  67. <span onclick="{!v.press}" value="{!v.value}">
  68. {!v.body}
  69. </span>
  70.  
  71. </aura:component>
  72.  
  73. <c:Button value="yourvaluehere" press="{!c.onPushTheButton}">
  74. <p style="background-color:green;">MyButton,images,whatever u want</p>
  75. </c:Button>
  76.  
  77. <lightning:button class="action-btns" value="yourValue" variant="neutral" label="something" onclick="{! c.handleAction }">
  78.  
  79. handleAction : function(component, event, helper) {
  80. var btnValue = event.getSource().get("v.value");
  81. }
Add Comment
Please, Sign In to add comment