salesforce datatable icon in cell code example
Example: salesforce datatable icon
{label: 'Provenance', fieldName: 'prYou can try declaring your column similar to whats shown below (providing a fieldname to be used in the js controller/helper to set the iconName)
{label: 'Provenance', fieldName: 'provenance' cellAttributes:
{ iconName: { fieldName: 'provenanceIconName' }, iconLabel: { fieldName: 'provenanceIconLabel' }, iconPosition: 'right' }}
dataList = dataList.map(function(rowData) {
if (rowData.provenance === 'value') {
rowData.provenanceIconName = 'utility:up';
rowData.provenanceIconLabel = 'up';
} else {
rowData.provenanceIconName = 'utility:down';
rowData.provenanceIconLabel = 'down';
}
return rowData;
});
cmp.set("v.dataList", dataList);
}ovenance' cellAttributes:
{ iconName: { fieldName: 'provenanceIconName' }, iconLabel: { fieldName: 'provenanceIconLabel' }, iconPosition: 'right' }}