Denis Denis - 2 months ago 15x
AngularJS Question

ui-grid grouping: ordering by aggregated value

Let's say i have array of people:

{name: 'Vasily', age: 18, salary: 5},
{name: 'Vasily', age: 25, salary: 10},
{name: 'Vasily', age: 30, salary: 15},
{name: 'Ivan' , age: 18, salary: 6},
{name: 'Ivan' , age: 25, salary: 9},

Each person has several rows in this array showing their salaries in different moments of life.

I want to
group by name
aggregate salary
and then sort by that aggregated salary. So that if i sort by aggregated salary descending i could see who earned more.

Here is plunker with what i got at this moment. This sorts by salary inside each group and i want to sort by salary globally.


Finally i found out the way. I had to use ui-tree-view instead. Here is the plunker