Having a json array that needs sorting in JavaScript. The EventName field should match the respective Age fields like 01-10 Days and 10-20 Days.
[
{Age: "01-10 Days", EventName: "Invoice AP Review", Value: 1, ActiveInvoices: []}
,{Age: "01-10 Days", EventName: "Invoice Distribution", Value: 5, ActiveInvoices: []}
,{Age: "01-10 Days", EventName: "Invoice Pay Pending", Value: 2, ActiveInvoices: []}
,{Age: "10-20 Days", EventName: "Invoice AP Review", Value: 1, ActiveInvoices: []}
,{Age: "10-20 Days", EventName: "Invoice Approval", Value: 2, ActiveInvoices: []}
,{Age: "10-20 Days", EventName: "Invoice Distribution", Value: 11, ActiveInvoices: []}
,{Age: "10-20 Days", EventName: "Invoice Paid", Value: 1, ActiveInvoices: []}
,{Age: "10-20 Days", EventName: "Invoice Pay Pending", Value: 2, ActiveInvoices: []}
]
If you can assist with sorting this data properly, here is a jsfiddle link for reference: http://jsfiddle.net/h829p07n/1/
// Desired Output
[
{Age: "01-10 Days", EventName: "Invoice AP Review", Value: 1, ActiveInvoices: []}
,{Age: "01-10 Days", EventName: "Invoice Distribution", Value: 5, ActiveInvoices: []}
,{Age: "01-10 Days", EventName: "Invoice Pay Pending", Value: 2, ActiveInvoices: []}
,{Age: "10-20 Days", EventName: "Invoice AP Review", Value: 1, ActiveInvoices: []}
,{Age: "10-20 Days", EventName: "Invoice Distribution", Value: 11, ActiveInvoices: []}
,{Age: "10-20 Days", EventName: "Invoice Pay Pending", Value: 2, ActiveInvoices: []}
,{Age: "10-20 Days", EventName: "Invoice Approval", Value: 2, ActiveInvoices: []}
,{Age: "10-20 Days", EventName: "Invoice Paid", Value: 1, ActiveInvoices: []}
]
Thank you in advance for your help!