Wednesday 7 June 2023

Get selected row id in aura component

 

Get selected row id in aura component




Below is aura:iteration example in aura componnet 

step 1: Define the data-record attribute and on click event

<aura:iteration items="{!v.ShowRecords}" var="acc">

<div class="slds-grid slds-wrap mainsearchBox">

<div class="imgDiv slds-col slds-size_2-of-12 slds-small-size_2-of-12 slds-medium-size_2-of-12" style="text-align:center;">

<div class="holder">                      

<div data-record="{!acc.Id}" onclick="{!c.goToProfile}"><a><img src="{!acc.Logo_URL}" class="logoImg" /> </a></div>        

</div>

</div>                             

</div>

</aura: iteration>



step 2:  Add the click event in controller.js

goToProfile : function(component, event, helper) {

console.log('goToProfile ------');

var selectedItem = event.currentTarget;

  

var Id = selectedItem.dataset.record;

console.log('Id='+Id);



Tuesday 6 June 2023

Increase quick action window width

 

Increase size (width) of Lightning Web Component Quick Action Modal Popup Salesforce



<aura:component controller="PaymentCalculatorController" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >

<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>

    <aura:attribute name="recordId" type="String" />

<aura:attribute name="actionWidth" type="string" default="75"/>


 <aura:html tag="style">             

        .slds-modal__container{        

        width: 100% !important;

        max-width: {!v.actionWidth}rem !important; 

        }      

        

        .slds-modal__footer {

        display: none;

        }

    </aura:html>





</aura: component >