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-record-form | |
record-id={recordId} | |
object-api-name="Account" | |
layout-type="Compact" | |
columns="1" | |
mode="readonly"> | |
</lightning-record-form> | |
</template> |
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
({ | |
searchHelper : function(component, event) { | |
var action = component.get('c.queryContact'); | |
action.setParams({ | |
'searchTxt': component.get("v.searchTxt") | |
}); | |
action.setCallback(this, function(response){ | |
var state = response.getState(); | |
console.log(' ==== ' + state); |
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
({ | |
Search: function(component, event, helper) { | |
var searchField = component.find('search'); | |
helper.searchHelper(component, event); | |
}, | |
}) |
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="searchContactController"> | |
<aura:attribute name="result" type="List" description="list of seached contacts"/> | |
<aura:attribute name="searchTxt" type="String" description="use for searching contacts"/> | |
<div class="slds-m-around_medium"> | |
<lightning:layout> | |
<lightning:layoutItem size="3" padding="around-small"> | |
<lightning:input value="{!v.searchTxt}" | |
required="true" |
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
public class searchContactController { | |
@auraEnabled | |
public static List<Contact> queryContact(String searchTxt) { | |
String queryStr = 'SELECT Id, Name FROM Contact WHERE NAME Like \'%' + searchTxt + '%\''; | |
return Database.query(queryStr); | |
} | |
} |
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
({ | |
initHelper : function(component, event, helper) { | |
helper.utilSetMarkers(component, event, helper); | |
}, | |
utilSetMarkers: function(component, event, helper){ | |
//Variables declared with the let keyword can have Block Scope. | |
//{ let x = 2; } x cannot be uset outside the block | |
var action = component.get("c.getAllTowers"); | |
action.setCallback(this, function(response){ |
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
({ | |
init : function(component, event, helper) { | |
helper.initHelper(component, event, helper); | |
} | |
}) |
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="TowerMapController" implements="force:appHostable,flexipage:availableForAllPageTypes">> | |
<aura:attribute name="mapMarkers" type="object" access="private"/> | |
<aura:attribute name="markersTitle" type="object" access="private"/> | |
<aura:handler name="init" value="{!this}" action="{!c.init}"/> | |
<aura:if isTrue="{!!empty(v.mapMarkers)}"> | |
<lightning:map mapMarkers="{!v.mapMarkers}" zoomLevel="10" markersTitle="{!v.markersTitle}"/> | |
</aura:if> | |
</aura:component> |