ENVIRONMENT
Servoy Version - 2021.3.0.3642
svyPopupFilter - 2.0.0
Servoy Type - NG Client
Operation System - Windows 10
PROBLEM
svyPopupFiler’s TEXT type filter is missing options that are in the NG Grid TEXT type filter.
STEPS
- Setup svyPopupFilter
- Setup NG Grid column filter type to TEXT
- Check NG Grid’s Filter
- Check svyPopupFilter
RESULT
NG Grid
- Contains, Not Contains
- Equels, not equals
- Starts with, Ends with
Popup Filter
COMMENT
I’m not sure what to call this. Not sure if it’s a bug, an oversight, or if it’s in the pipeline to be completed later. But all the other PopupFilter types are equal to the NG Grid filtering, just for whatever reason TEXT is limited.
What’s odd too is that the Free Search works by doing ‘contains’, so it does work there I’m just not sure why the Popup Filter can’t do it. Unless I’m missing something.
Hi John,
thank you for bringing this to attention.
the PopupFilter is meant to be an highly customizible component for data filtering.
Criteria for the TEXT token can be configured globally upon onSolutionOpen.
As described in wiki: https://github.com/Servoy/svyPopupFilte … t-operator
The TOKEN filter type used to search on TEXT fields by default will search for an exact match using the IS_IN clause. Is possible to change such behavior into a LIKE for SEARCH_WORD% or %SEARCH_WORD% by changing the default operator to LIKE or LIKE_CONTAINS.
// change default operator for TEXT token filters.
scopes.svyToolbarFilter.setPopupDefaultOperator(scopes.svyToolbarFilter.FILTER_TYPES.TOKEN, scopes.svyPopupFilter.OPERATOR.LIKE);
Further customizations can be applied with advanced options (as creating custom templates, where the user can possibly change operator in the popup dialog itself)
Hope this helps.
Best regards,
Paolo
paronne:
Hi John,
thank you for bringing this to attention.
the PopupFilter is meant to be an highly customizible component for data filtering.
Criteria for the TEXT token can be configured globally upon onSolutionOpen.
As described in wiki: https://github.com/Servoy/svyPopupFilte … t-operator
The TOKEN filter type used to search on TEXT fields by default will search for an exact match using the IS_IN clause. Is possible to change such behavior into a LIKE for SEARCH_WORD% or %SEARCH_WORD% by changing the default operator to LIKE or LIKE_CONTAINS.
// change default operator for TEXT token filters.
scopes.svyToolbarFilter.setPopupDefaultOperator(scopes.svyToolbarFilter.FILTER_TYPES.TOKEN, scopes.svyPopupFilter.OPERATOR.LIKE);
Further customizations can be applied with advanced options (as creating custom templates, where the user can possibly change operator in the popup dialog itself)
Hope this helps.
Best regards,
Paolo
Interesting, so I can change the default behavior from ‘Equals’ to ‘Contains’ atleast?
What I’m pointing out is that, by default the NG Grid already has ALL options accessible without needing to do this type of coding changes. That’s why I’m confused if this is an intentionally designed to not have it in the PopupFilter, or it could potentially be added in the future officially. Cus otherwise, I don’t want to recreate it myself if it’s going to be put in anyways.
NG Grid Filter
[attachment=1]Screenshot 2021-07-21 170803.png[/attachment]
PopupFilter
[attachment=0]Screenshot 2021-07-21 170835.png[/attachment]
Thank you,
John
Hi John,
using an exact match as default option is part of the original design of the filter.
As mentioned in my previous message, the PopupFilter has been intentionally designed to be highly customizable; allowing the developer to tailor it to it’s needs.
You can decide what UX fits best for your user; with the command i have previously mentioned, you can decide if the search on text always has to be a “contains or exact match or starts with”.
Is possible to extend the default template form for the TOKEN (TEXT) filter, in the extended form you can possibly introduce a checkbox/dropdown to allow the user toggle the operator from an “exact match” into a “contains”.
Can read more on custom templates at https://github.com/Servoy/svyPopupFilte … -templates
Has not been decided yet, nevertheless can’t exclude the default criteria will change from an “exact match” into a “starts with” in future releases.
As well can’t exclude to introduce a field in the standard template, allowing the user to toggle between “exact match” and “starts with”.
Will surely take your input into account when a decision will be made; you are always welcome to submit feature requests for enhancements at support.servoy.com
Regards,
Paolo