Created
June 10, 2020 04:06
-
-
Save JitendraZaa/b3ccd976d72e417730396a8bc6fb5e69 to your computer and use it in GitHub Desktop.
Data Table Demo
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> | |
<div class="slds-text-heading_large slds-text-align_left"> | |
Lightning DataTable - Infinite Scrolling | |
</div> | |
<br /> | |
<div class="slds-text-heading_medium"> Demo using @wire decorator </div> | |
<br /> | |
<div class="demo-only" style="padding:0.5rem;background:#16325c"> | |
<div class="slds-text-color_inverse slds-text-heading_small"> | |
If you keep scrolling & search for first employee name, you would find many <span style="background:#ff0000"> duplicate rows. </span> | |
<br /> As Wire methods must be used with <b> cacheable=true </b> and Apex parameter never changes [in this case always 10] , Salesforce is | |
not calling Apex at all to improve performance. | |
</div> | |
</div> | |
<br /> | |
<c-datatable_wire></c-datatable_wire> | |
<br /> | |
<div class="slds-text-heading_medium"> Demo using Imperative Apex </div> | |
<br /> | |
<div class="demo-only" style="padding:0.5rem;background:#16325c"> | |
<div class="slds-text-color_inverse slds-text-heading_small"> | |
If you keep scrolling & search for first employee name, you would <span style="background:#00FF00;color:#000"> not find duplicate rows. </span> | |
<br /> As Imperative can be used with <b> cacheable=false </b> , even when Apex parameter never changes [in this case always 10] , | |
Salesforce still makes server call everytime to get new records. | |
</div> | |
</div> | |
<br /> | |
<c-datatable_imperative></c-datatable_imperative> | |
</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
import { LightningElement } from 'lwc'; | |
export default class Datatable_demo extends LightningElement {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment