Skip to content

Instantly share code, notes, and snippets.

@svierk
Created January 27, 2024 08:13
Show Gist options
  • Save svierk/18fcec1d3dfeb7357ccb938f049c9eb6 to your computer and use it in GitHub Desktop.
Save svierk/18fcec1d3dfeb7357ccb938f049c9eb6 to your computer and use it in GitHub Desktop.
JS Code for Content Document Table LWC | Configuration
const ICONS = {
csv: 'doctype:csv',
default: 'doctype:attachment',
docx: 'doctype:word',
jpeg: 'doctype:image',
jpg: 'doctype:image',
pdf: 'doctype:pdf',
png: 'doctype:image',
pptx: 'doctype:ppt',
rtf: 'doctype:rtf',
txt: 'doctype:txt',
xlsx: 'doctype:excel',
xml: 'doctype:xml',
zip: 'doctype:zip'
};
const COLUMNS = [
{
label: '',
fieldName: 'icon',
type: 'contentDocumentIcon',
hideDefaultActions: true,
fixedWidth: 40
},
{
label: 'Title',
fieldName: 'preview',
type: 'contentDocumentPreview',
hideDefaultActions: true
},
{
label: 'Size',
fieldName: 'ContentSize',
hideDefaultActions: true,
initialWidth: 80,
cellAttributes: { alignment: 'right' }
},
{
label: 'Created',
fieldName: 'CreatedDate',
type: 'date',
hideDefaultActions: true,
initialWidth: 100
}
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment