I have a requirement to show as Accordion type for one of the column so that the list can show more data at once when the modal window appears with the list.
Sample JSON
eventData = [
{
eventTime: '10:35:47 AM',
firstName: 'Bill Pay',
eventsource: [{eventSource : 'Test', currentUrl:'URL'}]
},
{
eventTime: '11:35:47 AM',
firstName: 'Paper less - procative',
eventsource: [{eventSource : 'Test1', currentUrl:'URL'}]
}
What I like to see in the UI is something like
eventDesc to show as Accordion when clicked to show the details underneath it. In this case to show (eventSource : 'Test1', currentUrl:'URL') .
Sample JS code:
import { LightningElement ,api, wire, track} from 'lwc';
import LightningDatatable from 'lightning/datatable';
import matchCell from './exampleMatchCell.html';
export default class ExampleResultsTable extends LightningElement(LightningDatatable) {
@track results =[];
@track columns = [
{ label: 'Event Time', fieldName: 'eventTime' ,type:'text', sortable: true},
{ label: 'Event Name', fieldName: 'eventName', type: 'text',sortable: true},
{ label: 'Event Desc', fieldName: 'eventSource', type: 'matchScore',typeAttributes: {}},
];
@track eventData = [
{
eventTime: '10:35:47 AM',
firstName: 'Bill Pay',
eventsource: [{eventSource : 'Test', currentUrl:'URL'}]
},
{
eventTime: '11:35:47 AM',
firstName: 'Paper less - procative',
eventsource: [{eventSource : 'Test1', currentUrl:'URL'}]
}
];
static customTypes = {
matchScore: {
template: matchCell
}
}
connectedCallback() {
this.results = this.eventData;
}
}