VadimDez / ngx-order-pipe

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

Disable Sorting on a click #40

Closed giripradip closed 3 years ago

giripradip commented 6 years ago

I am using angular5 and I am sorting an array of objects using ngx-order-pipe for a table data. But data is again sorting when clicking on the table row. how to disable the sorting with a click?

VadimDez commented 6 years ago

Are you modifying any item of the list you're sorting on click? If so - that will trigger sorting.

giripradip commented 6 years ago

Nope, i am not modifying but i am getting the id of the item that i clicked.

nicolashedoire commented 6 years ago

Same problem when i click on the thead tr element... , that trigger sorting, how to solve this bug ?

giripradip commented 6 years ago

I am not using this pipe techniques for sorting. In angular, while scrolling the long list change detection event will be triggered. An angular pipe runs its functionality(in this case sorting) on each change detection event. That's why is it flickering while clicking or scrolling also. I am using another technique suggested by many angular developers. That is you can write your sorting logic in the component itself.

VadimDez commented 6 years ago

https://github.com/VadimDez/ngx-order-pipe#use-orderpipe-in-the-component

VadimDez commented 6 years ago

Could someone test this issue with version 2.0.0?

stale[bot] commented 3 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.