jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Order of Applying Filters?
Tagged: filtering
This topic contains 6 replies, has 2 voices, and was last updated by wizkid 11 years, 1 month ago.
-
Author
-
Hi,
I am using jqxGrid with multiple filters, which works fine until I try to mix a DropDownList and an Input for filtering. If I type in something to the Input first and then use the DropDownList the filters work correctly; however, if I use the DropDownList and then type in text for the Input, the DropDownList filter is overridden. What is the cause?
I have produced a JSFiddle (sorry this is definitely a quickly thrown together example): http://jsfiddle.net/GZWD6/17/
To reproduce:
//Working Correctly
Type in “B” to the text Input.
Select “AS” from DropDownList.
The grid is filtered correctly with “AS” AND CountyName containing “B” OR City containing “B”.//Not Correct
Select “AS” from DropDownList.
Type in “B” to the text Input.
The grid is not filtering correctly and instead seems to return “AS” OR CountryName containing “B” OR City containing “B”.How do I make this so the right logic is applied each time? Do the filters have to be applied in a specific order?
Thank you for any help you can provide!
Hi wizkid,
as far as I see, you have code for crearing the filters:
$("#jqxgrid").jqxGrid('clearfilters');
. the previous will clear all filters applied to jqxGrid.Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Peter,
That code is not executed in my example. I have commented the code out and the issue is still occurring. Please look further into my JSFiddle. Thanks for your assistance!
Hi wizkid,
If you want your filters to be not mutually exclusive, your filter_or_operator should be set to 0.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Peter,
That is not what I am trying to do. Please actually take a second to reproduce the steps I have outlined above.
I am trying to use the DropDownList to filter values, and then further refine the Grid values with the text from Input.
Thus, ContinentCode “AS” AND CountryName containing “B” OR City containing “B”.
You will notice that if you filter with the DropDownList first, the filters become:
ContinentCode “AS” OR CountryName containing “B” OR City containing “B”.
The operator is getting overridden if the DropDownList is selected first. It is working fine if I type in the Input first and THEN use the DropDownList. This is still an issue with the latest v.3.3.0 release.
Hi wizkid,
The Order of Applying filters to jqxGrid is the order in which you add your filters. I cannot add anything in addition to your post in this Forum. Updated: http://jsfiddle.net/prxTb/
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Thanks for trying Peter, but your modified example does not apply to the issue. It is clear to me that their is a bug in the order of applying filters that would suggest your team look further into. The operator between groups is overridden in certain scenarios.
-
AuthorPosts
You must be logged in to reply to this topic.