Here is the code that creates my tableModel:
const rowData = [{
id: '74b0d34f-1e2f-47d1-b1ea-55658d5d750f',
assetId: '9ff317cd-3b75-433d-a32b-949c67b84eee',
type: 'DATA_RECORDING',
eventStart: '2019-05-01T00:00:00Z',
eventEnd: '2019-05-01T00:00:00Z',
assetName: 584,
milliseconds: 3524583453452
},{
id: '74b0d34f-1e2f-47d1-b1ea-55658d5d7534',
assetId: '9ff317cd-3b75-433d-a32b-949c67b84eee',
type: 'DATA_RECORDING',
eventStart: '2019-05-01T00:00:00Z',
eventEnd: '2019-05-01T00:00:00Z',
assetName: 584,
milliseconds: 35245824528
},{
id: '74b0d34f-1e2f-47d1-b1ea-55658d5d7545',
assetId: '9ff317cd-3b75-433d-a32b-949c67b84eee',
type: 'DATA_RECORDING',
eventStart: '2019-05-01T00:00:00Z',
eventEnd: '2019-05-01T00:00:00Z',
assetName: 584,
milliseconds: 13219245949
}];
tableModel(data: Array<dataObj>) {
return [{
headers: ['DATE LOGGED', 'ASSET ID', 'DIVISION NAME', 'TYPE'],
displayedColumns: ['eventStart', 'assetId', 'divisionName', 'type'],
rows: rowData
}];
}
I want the default sort of the table rows to be based on the 'millisecond' properties of the row objects, but I do not want to display the property in the table. Is there a way to do this? I don't see anything about it in the docs and setting matSortStart="desc" just sorts the table based on the first column (eventStart in this case).