lundi 22 juillet 2019

Sort to desc and asc order based on selected property in an array javascript [duplicate]

This question already has an answer here:

I have an array with list of objects in that i need to sort "Asc" and "Desc" based on the property i selected.

Consider this an array

var array = [
{
triggerType: "Create",
txRefNo: "SCC507G710A1180815090948",
updateDate: "2015-08-18 12:01:31.0",
{
triggerType: "Create",
txRefNo: "SCC234G710A1180815090948",
updateDate: "2016-08-18 04:01:31.0",
}]

in this i need to sort asc and desc based on date and txrefno when button clicked.

like toggle if i click on one button or icon it will do both fucntionality.

How i wil do this on javascript or jquery




Aucun commentaire:

Enregistrer un commentaire