This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * JsonToCSVUtility Class | |
| * This class has helper functiones to convert json string to csv | |
| * @author - Manish Choudhari | |
| * */ | |
| public class JsonToCSVUtility { | |
| public static Integer MAX_ROW = 0; | |
| /** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <lightning-card title="SFDCFacts Calculator" icon-name="standard:formula"> | |
| <lightning-layout multiple-rows="true"> | |
| <lightning-layout-item size="12" padding="around-small"> | |
| <lightning-input type="number" label="First Number" name="firstName" onchange={onNumberChange}></lightning-input> | |
| </lightning-layout-item> | |
| <lightning-layout-item size="12" padding="around-small"> | |
| <lightning-input type="number" label="Second Number" name="secondName" onchange={onNumberChange}></lightning-input> | |
| </lightning-layout-item> | |
| <lightning-layout-item size="12" padding="around-small"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { LightningElement, track } from 'lwc'; | |
| export default class SimpleCalculator extends LightningElement { | |
| @track firstNumber; | |
| @track secondNumber; | |
| @track currentResult; | |
| @track operatorUsed; | |
| /** | |
| * This method will be called when either first number or second number is changed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata" fqn="SimpleCalculator"> | |
| <apiVersion>45.0</apiVersion> | |
| <targets> | |
| <target>lightning__AppPage</target> | |
| <target>lightning__RecordPage</target> | |
| <target>lightning__HomePage</target> | |
| </targets> | |
| </LightningComponentBundle> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <aura:component implements="flexipage:availableForRecordHome" access="global" > | |
| <!--intantiating unsaved changed component --> | |
| <lightning:unsavedChanges aura:id="unsavedData" | |
| onsave="{!c.saveData}" | |
| ondiscard="{!c.discardData}"/> | |
| <lightning:card title="Create Account"> | |
| <!-- Handle name change, make unsaved changes in this action as user has typed some value--> | |
| <lightning:input name="Name" aura:id="name" label="Enter name" onchange="{!c.handleDataChange}"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ({ | |
| /** | |
| * in this function we will set unsaved changes | |
| * as the user is changing data which should be saved | |
| * before page close | |
| * */ | |
| handleDataChange: function(component, event, helper) { | |
| //get instance of unsavedChanges component | |
| var unsavedData = component.find("unsavedData"); | |
| //set unsaved changes which will notify the user about saving the record on page close |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ({ | |
| saveAccount : function(component) { | |
| /************************ | |
| * I am writing dummy code to clear input boxes here, | |
| * but in real you need to save all unsaved changes here | |
| ***********************/ | |
| component.find("name").set("v.value", ""); | |
| component.find("phone").set("v.value", ""); | |
| } | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <aura:component implements="force:appHostable,flexipage:availableForRecordHome,force:hasRecordId"> | |
| <lightning:layout horizontalAlign="center"> | |
| <lightning:layoutItem> | |
| <lightning:select name='selectItem' aura:id="carType" label='All Types' | |
| variant="label-hidden" value=""> | |
| <option value="" text="All Types" /> | |
| <option value="" text="Sports Car" /> | |
| <option value="" text="Luxury Car" /> | |
| </lightning:select> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <aura:application extends="force:slds" > | |
| <c:CarSearchForm /> | |
| </aura:application> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <aura:component controller="CarTypeSearch" | |
| implements="force:appHostable,flexipage:availableForRecordHome,force:hasRecordId"> | |
| <!-- Attribute to controle visibility of New button --> | |
| <aura:attribute name="showNew" type="boolean" /> | |
| <aura:attribute name="carTypes" type="Car_Type__c[]"/> | |
| <aura:handler name="init" action="{!c.doInit}" value="{!this}"/> | |
| <!-- This event will be fired when user will click on |