Created
October 10, 2019 04:37
-
-
Save dhaniksahni/71c0a178e63009e73ded8aa2a58ba587 to your computer and use it in GitHub Desktop.
Use Extended Data Table in Lightning Web Component
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
<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> |
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
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