Untitled
unknown
plain_text
a year ago
2.7 kB
7
Indexable
<c-custom-data-table-header
columns={columnssss}
table-data={projects}
get-cell-class={getCellClass}
navigation-type="standard__recordPage"
onfilterchange={handleFilterChange}>
</c-custom-data-table-header>
@track columnssss = [
{ label: 'S. No', fieldName: 'S_No__c', dropdownOpen: false, isSortable: true},
{ label: 'Project ID', fieldName: 'Name', isSortable: true, search: true },
{ label: 'Project Name', fieldName: 'Project_Name__c', dropdownOpen: false, isSortable: true, filterType: 'Search', search: true},
{ label: 'Project Amount', fieldName: 'Project_Amount__c', isFilterable: true, dropdownOpen: false, filterOptions: ['Less than 150,000', 'Less than 50,000', 'Custom Range'], isSortable: true, filterType: 'Search', search: true},
{ label: 'Loan Type', fieldName: 'Loan_Type__c', isSortable: true, isFilterable: true, filterType: 'Search', filterOptions: ['Line of Credit', "Conventional Loan", 'Term Loan', "Unassigned"] , search: true},
{ label: 'Time Elapsed', fieldName: 'Time_Elapsed__c', isSortable: true, isFilterable: true, filterType: 'Search', filterOptions: ['Less than 30 days', 'More than 30 days', 'Custom Range']},
{ label: 'Days Remaining', fieldName: 'Days_Remaining__c',isSortable: true, isFilterable: true, filterType: 'Search', filterOptions: ['Less than 30 days', 'More than 30 days', 'Custom Range']},
{ label: 'Referred By', fieldName: 'Referred_By__c', isSortable: true, isFilterable: true, filterType: 'Search', filterOptions: ['Internal', 'External'] },
{ label: 'Stage', fieldName: 'Stage__c', isSortable: true, isFilterable: true, filterType: 'Search', filterOptions:['Discovery', 'Processing', "Drafted", 'Invite sent', 'Closing']}
];
getCellClass(value) {
if (value === 'Term Loan') {
return 'TermLoan-value-class'; // Class for high values
} else if (value === 'LoC') {
return 'inprogress-value-class'; // Class for low values
}
else if (value === 'Conventional Loan') {
return 'inprogress-value-class'; // Class for low values
}
return 'normal-value-class'; // Default class
}
selectedFilters = {};
handleFilterChange(event) {
const selectedFilters = event.detail.selectedFilters;
console.log('All selected filters:', selectedFilters);
console.log("Selected Filters:", JSON.stringify(selectedFilters, null, 2));
// You can now use this.selectedFilters to filter table data, etc.
}
}Editor is loading...
Leave a Comment