Skip to content

Instantly share code, notes, and snippets.

@dhaniksahni
Created October 10, 2019 04:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dhaniksahni/71c0a178e63009e73ded8aa2a58ba587 to your computer and use it in GitHub Desktop.
Save dhaniksahni/71c0a178e63009e73ded8aa2a58ba587 to your computer and use it in GitHub Desktop.
Use Extended Data Table in Lightning Web Component
<template>
<c-salesforce-codex-data-table
                key-field="id"
                data={data}
                show-row-number-column="false"
                hide-checkbox-column="false"
                columns={columns}>
 </c-salesforce-codex-data-table>
</template>
const columns = [
{ label: 'SR#', fieldName: 'rowNumber',type:'text'},
{ label: 'Profile Pic', fieldName: 'profile_image', type:'image'},
{ label: 'Member Name', fieldName: 'display_name' },
{ label: 'Website', fieldName: 'website_url' , type:'url'},
{ label: 'Reputation', fieldName: 'reputation' },
{ label: 'Gold Badge', fieldName: 'gold', type:'text',cellAttributes: { class: 'slds-text-color_error slds-text-title_bold'}},
{ label: 'Silver Badge', fieldName: 'silver', type:'text',cellAttributes: { class: 'slds-text-color_warning slds-text-title_bold'}},
{ label: 'Bronze Badge', fieldName: 'bronze' , type:'text',cellAttributes: { class: 'slds-text-color_success slds-text-title_bold'}},
{ label: 'Is Employee', fieldName: 'is_employee' },
{ label: 'Created Date', fieldName: 'date', type: "date",
typeAttributes:{
year: "numeric",
month: "2-digit",
day: "2-digit"
}},
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment