angular-filter icon indicating copy to clipboard operation
angular-filter copied to clipboard

sorting by headers after using Group By Filter

Open pola2raghu opened this issue 8 years ago • 9 comments

here i want sort by group by clicking the header.

pola2raghu avatar Jan 27 '16 17:01 pola2raghu

Can you provide more details or a Plunker?

toddbranch avatar Jan 27 '16 18:01 toddbranch

this is my plunk

i am grouping three columns and showing results,

now i need to sort the data by click the header of those columns that are used to group and the data must be in group

http://plnkr.co/edit/uJilmFvMzJozlo2ujMte?p=preview

i have to sort header

Thanks, Raghu

On Wed, Jan 27, 2016 at 12:15 PM, Todd Branchflower < [email protected]> wrote:

Can you provide more details or a Plunker?

— Reply to this email directly or view it on GitHub https://github.com/a8m/angular-filter/issues/184#issuecomment-175778626.

pola2raghu avatar Jan 27 '16 21:01 pola2raghu

ng-repeat="(key, value) in CrewHist | groupBy: '[Scheduler, Date, Time]' | orderBy:'+key'"

I'm not completely clear on what you're trying to do. But, reading through the groupBy source, it does not support grouping by an array of properties.

toddbranch avatar Jan 27 '16 21:01 toddbranch

Hi @pola2raghu, please take a look on this example: order-groupby-result. Thanks.

a8m avatar Jan 28 '16 10:01 a8m

I am grouping multiple columns , In the example it has only one category,

In the example we have 2 ngrepeat's I need sort by parent $index

Thanks, Raghu

On Jan 28, 2016, at 4:20 AM, Ariel Mashraki [email protected] wrote:

Hi @pola2raghu, please take a look on this example: order-groupby-result. Thanks.

— Reply to this email directly or view it on GitHub.

pola2raghu avatar Jan 28 '16 12:01 pola2raghu

Grouping is working fine with multiple key's

Order by is not working

Thanks, Raghu

On Jan 28, 2016, at 4:20 AM, Ariel Mashraki [email protected] wrote:

Hi @pola2raghu, please take a look on this example: order-groupby-result. Thanks.

— Reply to this email directly or view it on GitHub.

pola2raghu avatar Jan 28 '16 15:01 pola2raghu

My bad @pola2raghu - think @a8m is right. Try this: ng-repeat="(key, value) in CrewHist | groupBy: '[Scheduler, Date, Time]' | toArray:true | orderBy:'$key'"

toddbranch avatar Jan 28 '16 17:01 toddbranch

Thanks it's ordering but I need to sort by headers

Thanks, Raghu

On Jan 28, 2016, at 11:26 AM, Todd Branchflower [email protected] wrote:

My bad @pola2raghu - think @a8m is right. Try this: ng-repeat="(key, value) in CrewHist | groupBy: '[Scheduler, Date, Time]' | toArray:true | orderBy:'$key'"

— Reply to this email directly or view it on GitHub.

pola2raghu avatar Jan 28 '16 17:01 pola2raghu

I think this filter module should handle all common function like orderBy, sort ect. Without manipuling ourself the javascript

onigetoc avatar Apr 09 '17 22:04 onigetoc