mariuszfoltak/angular2-datatable

Sorting rows by values of row property that is array with mfDefaultSorter

Opened this issue · 1 comments

Is there a way to sort orders by the sum of the items quantity (without changing the structure of the orders array):

const orders = [
  {
    id: 1,
    title: 'Order 1'
    items: [
      {quantity: 20},
      {quantity: 30},
      {quantity: 40},
    ]
  },
  {
    id: 2,
    title: 'Order 2'
    items: [
      {quantity: 50},
      {quantity: 10},
    ]
  }
];
<mfDefaultSorter [by]="?????">Quantity</mfDefaultSorter>