Skip to content

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

@iDGE90

Description

@iDGE90

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions