VadimDez / ngx-order-pipe

▼ Angular 5+ orderBy pipe
https://vadimdez.github.io/ngx-order-pipe/
MIT License
243 stars 57 forks source link

Reordering during click #33

Closed Emkacf closed 4 years ago

Emkacf commented 6 years ago

Hi,

I've implemented the ngx-order-pipe in angular 5 app where I am sorting the table on which rows are clickable to show more data and pipe is reordering the rows on click. May it be angular 5 compatibility issue/bug or I am doing something wrong?

`<ng-container *ngFor="let vdb of vdbs | orderBy: order">'

And my structure looks like that (clicking on row toogle the hidden table with multiple rows):

table
  row
    hidden table
  row
    hidden table

My sortable field is in main table rows

order: string = 'content.properties.DOMAIN.__text';

tabirkeland commented 6 years ago

Same issue. I believe it is due to the pipe being impure, changed in this commit https://github.com/VadimDez/ngx-order-pipe/commit/90216f462ffb92be4e7a0f533265f3e558a4913a. I created my own pipe that extends the OrderPipe like so:

import { Pipe } from '@angular/core';

import { OrderPipe } from 'ngx-order-pipe'

@Pipe({name: 'orderColumn'})
export class OrderColumnPipe extends OrderPipe
{

}

Working fine.

MarkusPint commented 6 years ago

Same issue

VadimDez commented 6 years ago

What version of ngx-order-pipe are you using?

nosTa1337 commented 6 years ago

I had the same problem with the latest version and solved it with @tabirkeland solution. thanks.

grobii commented 6 years ago

For me, it's working with version 2.0.1

bluecaret commented 4 years ago

Thank you @tabirkeland your solution worked for me as well!

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.