Salesforce Lightning Aura Component

Salesforce

How to get content from lightning:inputRichText without HTML Tags?

Sample Code: Lightning Component: <aura:component implements = "force:appHostable">              <aura:attribute name="myVal" type="String" />              <div class="slds-box slds-theme_default">                      <lightning:inputRichText value = "{!v.myVal}"/>           <lightning:button variant = "brand" label = "Show" onclick = "{! c.handleClick }"/>                  </div>          </aura:component>   Lightning Component Controller: ({              handleClick : function(component, event, helper) {                      var tempVal = component.get("v.myVal");           var tempDivElement = document.createElement("div");           tempDivElement.innerHTML = tempVal;           alert( "With HTML Tags " + tempVal );           tempVal = tempDivElement.textContent;           alert( "Without HTML Tags " + tempVal );              ....

Salesforce

Custom Lightning Template with Scroll Options in Salesforce

Sample Code: Lightning Component: <aura:component implements="lightning:recordHomeTemplate">                  <aura:attribute name = "left" type = "Aura.Component[]" />         <aura:attribute name = "middle" type = "Aura.Component[]" />         <aura:attribute name = "right" type = "Aura.Component[]" />                  <table>             <tr cellpadding = "8" cellspacing = "8" style="vertical-align:top;">                 <td width="14%">                     <div class="slds-scrollable" style="height:900px;">{!v.left}</div>                 </td>                 <td width="1%"></td>                 <td width="45%">                     <div class="slds-scrollable" style="height:900px;">{!v.middle}</div>                 </td>                 <td width="1%"></td>                 <td width="39%">                     <div class="slds-scrollable" style="height:900px;">{!v.right}</div>                 </td>             </tr>         </table>              </aura:component>    Design: <design:component>   ....

Salesforce

Inline editing in lightning:datatable in Salesforce Lightning Component

Sample Code:Component:<aura:component implements="force:appHostable"                    controller="AccountListController">                <aura:attribute type="object" name="acctList"/>        <aura:attribute name="mycolumns" type="List"/>                <aura:handler name="init" value="{!this}" action="{!c.onInit}"/>                <lightning:datatable aura:id="acctTable"  ....

Salesforce

Collapsible Pane in Lightning Component Salesforce

Sample Code:Component: <aura:component implements="force:appHostable"> <aura:attribute name="activeSections" type="List" default="['a']" /> <aura:attribute name="activeSectionsMessage" type="String" default="" /> <div class="slds-box slds-theme_default"> <p>{! v.activeSectionsMessage }</p> <lightning:accordion allowMultipleSectionsOpen="true" onsectiontoggle="{! c.handleSectionToggle }" activeSectionName="{! v.activeSections }"> <lightning:accordionSection name="a" ....

Salesforce

How to call JAVASCRIPT method on Enter key press in Salesforce Lightning component?

Sample Code: Component: <aura:component implements="force:appHostable" > <aura:attribute name="strText" type="String"/> <div class="slds-box slds-theme_default"> <span onkeypress="{!c.callKeyUp}"> <lightning:input label="Enter Text" value="{!v.strText}" /> </span> </div> </aura:component> Component Controller: ({ callKeyUp : function(component, event, helper) ....

Salesforce

How to get record id in lightning:recordEditForm?

Component: <aura:component > <div class="slds-box slds-theme_default"> <lightning:recordEditForm objectApiName = "Opportunity" onsuccess = "{! c.handleSuccess }"> <lightning:inputField fieldName="Name" /> <lightning:inputField fieldName="StageName" /> <lightning:inputField fieldName="CloseDate" /> <lightning:inputField fieldName="AccountId" /> <lightning:button class="slds-m-top_small" variant="brand" ....