Skip to content

Instantly share code, notes, and snippets.

View sakthivelsfdc's full-sized avatar

Sakthivel Madesh sakthivelsfdc

View GitHub Profile
import { LightningElement, track } from 'lwc';
import searchAccounts from '@salesforce/apex/AccountController.searchAccount';
const columnList = [
{label: 'Id', fieldName: 'Id'},
{label: 'Name', fieldName: 'Name'},
{label: 'Website', fieldName: 'Website'},
{label: 'Industry', fieldName: 'Industry'}
];
<template>
<lightning-card title = "Search Accounts" icon-name = "custom:custom10">
<div class = "slds-m-around_medium">
<lightning-input type="search" onchange={findAccountResult} class = "slds-m-bottom_small" label = "Search"> </lightning-input>
<lightning-datatable key-field="Id" data={accountList} columns={columnList} hide-checkbox-column="true" show-row-number-column="true">
</lightning-datatable>
<template if:true= {noRecordsFound}>