Posts

Showing posts from October, 2018

How to edit the records in salesforce lightning

Image
Component ------------- <aura:component implements="force:appHostable,                 flexipage:availableForAllPageTypes, flexipage:availableForRecordHome, force:hasRecordId, forceCommunity:availableForAllPageTypes"                 access="global"                 controller="AccountCtrl"> <aura:handler name="init" value="{!this}" action="{!c.doinit}"/>         <aura:attribute name="Acclist"  type="list"/>           <div>             <table class="slds-table slds-table_cell-buffer slds-table_bordered">               <thead>                 <tr class="slds-line-height_reset">                   ...

How to get the child component value in parent component

Image
SampleEvent.evt -------------------- <aura:event type="component"  description="This is my first Event"> <aura:attribute name="info"  type="String"/> </aura:event> ChildComponent.cmp ------------------ <aura:component> <aura:registerEvent name="SampleComponentEvent" type="c:SampleEvent"/> <ui:button label="Showdata"  press="{!c.childComponentMethod}"/> </aura:component> ChildComponentController ------------------------ ({ childComponentMethod:function(component,event,helper){ var v1=component.getEvent("SampleComponentEvent"); v1.setParams({ "info":"Brahmanaidu"   }); v1.fire(); } }) ParentComponent.cmp -------------------------- <aura:component> <aura:attribute name="eventmessage"   type="String"/> <aura:...

Simple calculator program in lightning

Image
<aura:component>  <aura:attribute name="no1" type="Integer"/>  <aura:attribute name="no2" type="Integer"/>  <aura:attribute name="Total" type="Integer"/>   <div align="center">  <ui:inputnumber label="Number1" value="{!v.no1}" placeholder="Enter the number1"/>  <ui:inputnumber label="Number2"  value="{!v.no2}" placeholder="Ente the number2"/>     <br></br>  <div class="backgroundInverse">      <lightning:buttonGroup>            <lightning:button  label="add"   onclick="{!c.addOperation}"/>            <lightning:button  label="sub"   onclick="{!c.subOperation}"/>            <lightning:button  label="mul"   onclick="{!c.mulOperation}"/>            <lightning:b...

How to get the selected record details in salesforce Lightning

Image
AccountDataFirstComponent.cmp ----------------------------------------- <aura:component implements="force:appHostable"  controller="AccountCtrl">     <aura:attribute name="accdata" type="List"/>     <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>      <table class="slds-table slds-table--bordered slds-table--striped slds-table--cell-buffer slds-table--fixed-layout">     <thead>     <tr class="slds-text-heading--label">     <th scope="col"><div class="slds-truncate" title="ID">ID</div></th>     <th scope="col"><div class="slds-truncate" title="Name">Name</div></th>     <th scope="col"><div class="slds-truncate" title="Site">Site</div></th>     </tr>     </thead...