I have this array :
displayedColumns = ['CompanyName','Ticker', 'Id', 'Name', 'ActualTradeDate',
'Spot', 'PreviousTradeDate', 'PreviousSpot', 'FPrice', 'Status']
and an array of objects with the above values as properties :
data : [{Ticker : ".. " ......... Status : "... " } , .... {...} ]
but the properties in the data array are not sorted in the 'displayedColums' order (as wanted )
the end wanted result is :
data = [{ CompanyName : ".. " Ticker : ".."......Status : ".." },
{ CompanyName : ".. " Ticker : ".."......Status : ".." },....
{ CompanyName : ".. " Ticker : ".."......Status : ".." }]
**just to be clear, I am not looking to sort the array by asc/desc values of a certain property. I want to change the order of the properties in the array to 'displayedColumn' order
I am not sure how to sort an array by property order. thanks a lot