Created
July 10, 2019 10:08
-
-
Save sakthivelsfdc/40768b43fa716179dba869d235a15ca3 to your computer and use it in GitHub Desktop.
This file contains 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'; | |
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'} | |
]; | |
export default class LightningDataTable extends LightningElement { | |
@track accountList; | |
@track columnList = columnList; | |
@track noRecordsFound = true; | |
findAccountResult(event) { | |
const accName = event.target.value; | |
if(accName) { | |
searchAccounts ( {accName}) | |
.then(result => { | |
this.accountList = result; | |
this.noRecordsFound = false; | |
}) | |
} else { | |
this.accountList = undefined; | |
this.noRecordsFound = true; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment