jQuery UI Widgets › Forums › Grid › Default Filter Condition in Grid Filter Dropdown
Tagged: filtering, jquery grid filtering
This topic contains 6 replies, has 2 voices, and was last updated by Sibeesh Venu 9 years, 2 months ago.
-
Author
-
How Can I set ‘Equal’ as the default filter condition in grid, that is, when ever user clicks on filter icon, the first filter condition must be ‘Equal’. I am asking something like this.
Kindest Regards
Sibeesh VenuHi Sibeesh,
You need to implement the updatefilterpanel function. We have online demo – http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/filterconditions.htm?arctic
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comIn that demo you are applying a default filter, I do not need to apply any filter, I just need that ‘Equal’ condition should come first in the drop down for all type of filter( String, numeric).
Hi Sibeesh,
In that demo we do many things one of which is to implement updatefilterpanel.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comPlease be noted that I have already applied that.
rendered: function () { var localizationobj = {}; filterstringcomparisonoperators = ['empty', 'not empty', 'equal', 'contains', 'does not contain', 'starts with', 'ends with', 'null']; filternumericcomparisonoperators = ['not equal', 'less than', 'equal', 'less than or equal', 'greater than', 'greater than or equal', 'null', 'not null']; filterdatecomparisonoperators = ['not equal', 'less than', 'equal', 'less than or equal', 'greater than', 'greater than or equal', 'null', 'not null']; filterbooleancomparisonoperators = ['equal', 'not equal']; localizationobj.filterstringcomparisonoperators = filterstringcomparisonoperators; localizationobj.filternumericcomparisonoperators = filternumericcomparisonoperators; localizationobj.filterdatecomparisonoperators = filterdatecomparisonoperators; localizationobj.filterbooleancomparisonoperators = filterbooleancomparisonoperators; // apply localization. $(openFrom + "#jqxgrid").jqxGrid('localizestrings', localizationobj); }, updatefilterconditions: function (type, defaultconditions) { var stringcomparisonoperators = ['EMPTY', 'NOT_EMPTY', 'EQUAL', 'CONTAINS', 'DOES_NOT_CONTAIN', 'STARTS_WITH', 'ENDS_WITH', 'NULL']; var numericcomparisonoperators = ['NOT_EQUAL', 'LESS_THAN', 'EQUAL', 'LESS_THAN_OR_EQUAL', 'GREATER_THAN', 'GREATER_THAN_OR_EQUAL', 'NULL', 'NOT_NULL']; var datecomparisonoperators = ['NOT_EQUAL', 'LESS_THAN', 'EQUAL', 'LESS_THAN_OR_EQUAL', 'GREATER_THAN', 'GREATER_THAN_OR_EQUAL', 'NULL', 'NOT_NULL']; var booleancomparisonoperators = ['EQUAL', 'NOT_EQUAL']; switch (type) { case 'stringfilter': return stringcomparisonoperators; case 'numericfilter': return numericcomparisonoperators; case 'datefilter': return datecomparisonoperators; case 'booleanfilter': return booleancomparisonoperators; } }
I have tried even changing the condition order, but still it is not working. Please check and help me.
And I have already asked this in past.
http://www.jqwidgets.com/community/topic/order-jqx-grid-jqwidget-filter-conditions/I have done it by adding
updatefilterpanel: function (filtertypedropdown1, filtertypedropdown2, filteroperatordropdown, filterinputfield1, filterinputfield2, filterbutton, clearbutton, columnfilter, filtertype, filterconditions) { var index1 = 0; var index2 = 0; filtertypedropdown1.jqxDropDownList({ autoDropDownHeight: true, selectedIndex: index1 }); filtertypedropdown2.jqxDropDownList({ autoDropDownHeight: true, selectedIndex: index2 }); }
Thanks a lot for your help.
-
AuthorPosts
You must be logged in to reply to this topic.