Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
iDGE90 opened this issue Aug 22, 2018 · 1 comment
Open

Comments

@iDGE90
Copy link

iDGE90 commented Aug 22, 2018

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>
@iDGE90 iDGE90 changed the title Sorting rows by values of row property that is array Sorting rows by values of row property that is array with mfDefaultSorter Aug 22, 2018
@iDGE90
Copy link
Author

iDGE90 commented Aug 23, 2018

If any one needs solution https://stackoverflow.com/questions/51983303/angular-2-angular2-datatable-sorting-rows-by-values-of-row-property-that-is/51983457#51983457

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant