Page 1 of 1
Filtering rows on a subform [done]
Posted: Sat Apr 16, 2022 11:21 am
by nac
This would be a new generic option for any object that is placed on a subform but it would use the code already developed for some of the globeadmin forms (see the example below).
It would be a simple checkbox property for the object, ignored if not on a subform. If checked, the 'select' filter would be displayed and populated with each unique value in alphabetical order. The behaviour would be exactly the same as with the objects subform example shown. Multiple filters on the subform could be combined with 'AND'.
The filter would not require any reloading of the subform data; it would only filter the records loaded when the form is opened/refreshed.
subform_filter.png
Re: Filtering rows on a subform
Posted: Thu Apr 21, 2022 1:28 am
by kev1n
Hi Neil,
How about using Select2? The filtering could probably be done in a similar manner as in nuSortSubform() where a new top position is set for a row.
For the rows that do not need to be displayed, nuHide() can be used.
Re: Filtering rows on a subform
Posted: Thu Apr 21, 2022 10:57 am
by nac
Thanks for your response, kev1n.
Select 2 would be fine if that would be the easiest way to implement this. My thinking was to make use of the subform filtering code that is already in place for the 'Tab' column in the list of objects (which you developed) by converting this to a generic feature.
Neil
Re: Filtering rows on a subform
Posted: Thu Apr 21, 2022 11:01 am
by kev1n
nac wrote: ↑Thu Apr 21, 2022 10:57 am
My thinking was to make use of the subform filtering code that is already in place for the 'Tab' column
The filtering is done by SQL and a form refresh there. That means it is fundamentally different and I'm afraid that we can't make use of that code.
Re: Filtering rows on a subform
Posted: Fri Apr 22, 2022 11:12 am
by nac
Thanks for letting me know, kev1n. I did not realise it was performing a form refresh - I should have looked more closely.
Looking at nuSortSubform(), perhaps its functionality could be expanding so that the filter condition (if set) is used to determine if a subform row is displayed during the rewrite?
Neil
Re: Filtering rows on a subform
Posted: Fri Apr 22, 2022 7:03 pm
by kev1n
It gets tricky when both are both sorted and filtered.
Re: Filtering rows on a subform
Posted: Fri Apr 29, 2022 2:59 pm
by kev1n
To filter a subform by multiple columns (based on Neil's initial version)
To-do:
- Make it work when the subform is filtered.
- Add the ability to filter a column based on the partial match of a word
- Automatically add the populated Select element
Re: Filtering rows on a subform
Posted: Thu May 05, 2022 6:00 pm
by kev1n
Github updated with current code. It's under active development.
filter.png
Re: Filtering rows on a subform
Posted: Wed May 11, 2022 6:59 am
by kev1n
This is now on Github. Documentation will follow shortly.