Hi,
Will it be possible to filter the content of a subform based on the date in the parent form ?
Many thx,
Yves
Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
How to filter subform with value in parent form Topic is solved
-
- Posts: 315
- Joined: Sun Mar 14, 2021 8:48 am
- Location: Geneva
- Has thanked: 87 times
- Been thanked: 11 times
How to filter subform with value in parent form
You do not have the required permissions to view the files attached to this post.
-
- nuBuilder Team
- Posts: 4292
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 71 times
- Been thanked: 444 times
- Contact:
Re: How to filter subform with value in parent form
Yes, subforms support filtering. I'll share an example shortly.
-
- Posts: 115
- Joined: Tue Dec 12, 2017 11:28 pm
- Location: Aberdeen, UK
- Has thanked: 9 times
- Been thanked: 12 times
Re: How to filter subform with value in parent form
Hello Yves,
There is a function in nuBuilder that lets you add filters to one or more columns in a subform. Let's assume that your subform is called sf_one and you wish to filter on columns one_date and one_patient.
You can add this JavaScript to the custom edit code and it should do the job for you.
In this example, the date filter will offer every unique date in a select object. The patient search will be in a text object with datalist completion.
I hope this helps.
Neil
There is a function in nuBuilder that lets you add filters to one or more columns in a subform. Let's assume that your subform is called sf_one and you wish to filter on columns one_date and one_patient.
You can add this JavaScript to the custom edit code and it should do the job for you.
Code: Select all
var sfFilterSpecs = {};
sfFilterSpecs['sf_one'] = {
'one_date': { type: 'select', blank: false } ,
'one_patient': { type: 'search', datalist: true, blank: true }
};
nuSubformAddFilter(sfFilterSpecs);
I hope this helps.
Neil