I'm submitting a ...
[x] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35
Plunkr Case (Bug Reports)
Please fork the plunkr below and create a case demonstrating your bug report. Issues without a plunkr have much less possibility to be reviewed.
http://plnkr.co/edit/H3TxeAAE2pPBj034a2RG?p=preview
Current behavior
When I select a filter in a dropdown custom filter, it also change the sort order of the column
Expected behavior
Filter should change but not the sort order of the column
Minimal reproduction of the problem with instructions
In my plunker, select the dropdown of Brands, choose any brands that are available in the datatable and the sort order of the column will reverse itself.
What is the motivation / use case for changing the behavior?
Please tell us about your environment:
Windows, Atom
Angular version: 2.0.1
PrimeNG version: 2.0.0-rc.1
Browser: [all]
Language: [all]
Node (for AoT issues): node --version = 6.9.2
Your plunker works fine for me. But I have to admit that I had same issue with Calendar. All you need to do: add [appendTo]="body" for your dropdown
Here is a screen record of my plunker : https://giphy.com/gifs/26gs7hvahkCqvFKyA
You can see the sort icon changing direction when I click on the filter dropdown.
I tried your recommandation but it doesn't work for me.
I still have that bug in 2.0.0-rc.2
I also have that bug.
See this plunker: http://plnkr.co/edit/yqXCqX
To reproduce: choose some cars from the dropdown, then you'll see the sort changing.
Angular version 2.4.0
PrimeNG version 2.0.2
The _[appendTo]="body"_ solution doesn't work.
I also have the same problem
Angular version 2.4
PrimeNG version: 2.0.4
For a work-around I just used a regular Select element w/ ngModel
<select [(ngModel)]="dropdownValue">
<option value="Equals"> Equals </option>
<option value="Greater Than"> Greater Than </option>
<option value="Whatever"> Whatever </option>
</select>
@drakkie but how do you apply the sort with your regular select element ?
Do you use a custom filter function ?
Would be good if PrimeNG correct this bug in futur version please.
@Samisama I do use a custom filtering function. I actually have the select element in its own component/module and use inputs to define the field and table data and output the filtered table data since there are no built in number or date filter modes (string only) built in
Now that PrimeNG 4 is out I guess they will never correct that bug for users of Angular 2.4.6 and PrimeNG 2.0.5 ...?
Most helpful comment
I also have that bug.
See this plunker: http://plnkr.co/edit/yqXCqX
To reproduce: choose some cars from the dropdown, then you'll see the sort changing.
Angular version 2.4.0
PrimeNG version 2.0.2
The _[appendTo]="body"_ solution doesn't work.