Lightning Component JavaScript Controller

Salesforce

How to use Name instead of Id in lightning:dataTable URL

tooltip can be used to show Name instead of Id in URL type.Sample Code:Component: <aura:component implements="force:appHostable"                   controller="AccountListController">                    <aura:attribute type="Account[]" name="acctList"/>    <aura:attribute name="mycolumns" type="List"/>        <aura:handler name="init" value="{!this}" ....

Salesforce

lightning:recordEditForm getting Record Id after insert

Sample Code:Component:<aura:component implements="force:lightningQuickAction,force:hasRecordId" controller="NewCaseController">        <lightning:recordEditForm objectApiName="Case" onsuccess="{!c.handleSuccess}" aura:id="myRecordForm">        <lightning:messages />        <lightning:inputField aura:id="field" fieldName="Subject" />        <lightning:inputField aura:id="field" fieldName="Origin" />        <lightning:inputField aura:id="field" fieldName="Reason" />                <div class="slds-m-top_medium">            <lightning:button type="submit" label="Save Record"/>        ....

Salesforce

lightning:treegrid select child rows upon selecting parent row in Salesforce

Sample Code:Example.cmp:<aura:component implements="force:appHostable"                 controller="AccountListController">     <aura:attribute name="gridColumns" type="List" />    <aura:attribute name="gridData" type="Object" />    <aura:attribute name="selectedRows" type="list" />        <aura:handler name="init" value="{!this}" action="{!c.fetchAccounts}"/>        <lightning:treeGrid columns="{! v.gridColumns }"        data="{! v.gridData }"        ....

Salesforce

How to update Sub Query data in Lightning Component JavaScript Controller?

In the below example, I have updated the contact name to 'Testing'. Sample code: Lightning component: <aura:component implements = "force:appHostable"                   controller = "AccountListController">                <aura:attribute type = "object[]" name = "acctList"/>                <aura:handler name = "init" value = "{!this}" action = "{!c.onInit}"/>              <div class = "slds-box slds-theme_default">               <aura:iteration items = "{! v.acctList }" var = "acc">                               Account Name - {! acc.Name }<br/>                              <aura:iteration items = "{! acc.Contacts }" var = "con">    ....