jQWidgets Forums
jQuery UI Widgets › Forums › Grid › showfilterrow with custom filter operator does not select a default operator
This topic contains 3 replies, has 2 voices, and was last updated by ivanpeevski 3 years, 1 month ago.
-
Author
-
May 31, 2022 at 10:20 pm showfilterrow with custom filter operator does not select a default operator #121768
Hi,
When creating a grid with custom filter conditions as described here and having the showfilterrow set to “true”, then when the grid is loaded, there is no default filter condition selected (click a random column and dropdown the filter condition to notice no default filter condition is selected/highlighted). if the user key-enters data into the search column without selecting a condition an error occurs because no default filter condition is selected.
Uncaught TypeError: Cannot read properties of undefined (reading 'toUpperCase') at i.jqx.filter.createfilter (jqx-all.js:17:73653) at c.<computed>._applyfilterfromfilterrow (jqx-all.js:97:48249) at jqx-all.js:97:55873
When user expands the filterrow dropdow and selects a condition and search, the search functionality will work. (no error).
When settings the showfilterrow to “false” and expanding the filter condition widget, then you’ll notice that a default condition is selected. User is able to apply a search without getting the previous error.
Expectation is that when using Custom Filter Conditions and using the showfilterrow=true, one of the filter conditions is selected by default on grid initialization. Please also provide explaination how the default selected condition is determined. It currently looks like it takes the middle condition of the condition array.
Note the JSFiddle is just there to proof a point, the remote filtering is not working in this example.
showfilterrow false – no default selected filter condition resulting in error when filtering
https://jsfiddle.net/notedop/7nmLo5ds/36/showfilterrow true – default selected filter condition (GREATER THAN), no error when filtering
https://jsfiddle.net/notedop/7nmLo5ds/37/regards,
RaoulMay 31, 2022 at 10:30 pm showfilterrow with custom filter operator does not select a default operator #121769Some additional observations
- When showfilterrow=true then on each column the values from the “filterstringcomparisonoperators” array are visible.
- When showfilterrow=false then the first 2 columns the values from the “filternumericcomparisonoperators” array are visible and the last column has the “filterstringcomparisonoperators” applied.
so when filterrow is enabled, the filter is not using the data type defined in the source to dynamically determine the filtertype. I’m not sure if this is as expected or not, but want to make awareness that there are clear differences between the behavior of filterrow enabled versus disabled.
May 31, 2022 at 10:44 pm showfilterrow with custom filter operator does not select a default operator #121770Ok, i found one issue with my configuration. I was using filterType: “input” for both showfilterrow true and false (and on all columns), while the documentation states this can only be used with showfilterrow true.
When using filterType: “input” with showfilterrow true, then still no default filter condition is selected.
Is it possible to somehow set this?See columns, first 2 filters have first value as default condition, while last column has none.
https://jsfiddle.net/notedop/7nmLo5ds/46/June 1, 2022 at 3:54 pm showfilterrow with custom filter operator does not select a default operator #121773Hi notedop,
Thank you for the detailed feedback!
I have created a work item regarding this problem and we will work on fixing it as soon as possible.
And yes, as you can see in your examples, when showfilterrow is false, the middle element of the selection array is chosen as default. When showfilterrow is true, the first element is picked as default.Best Regards,
Ivan Peevski
jQWidgets Team
https://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.