Browse form in a Edit form : extended filters
Posted: Mon Jun 23, 2014 7:45 pm
Hi,
I'm trying to dynamically filter a Browse form displayed in a tab of an Edit form : Browse form is based on a view and then filter with the pk (prf_id) from the record of the Edit form :
Dropdown boxes are populated with 2 SQL queries also filtered with the pk used above :
The corresponding fields filter_dd_classes & filter_dd_periode don't exist in the table used by the Edit form, so they can't be saved (even if they're considered as "data_saveable").
On load, the nuFORM.form_data for the Browse form is populated with empty values for the 2 above fields.
How can I pass the values from the Edit form to the nuFORM.form_data of the Browse form with JavaScript and onchange event for each dropdown ?
If it's possible, a click on the Find (Chercher) button will then filter the Browse form according to the values in filter_dd_classes & filter_dd_periode fields.
To do so, I will also need to modify my previous SQL query for the Browse form to something like that :
But I'm completely lost in javascript/jquery/DOM and I have no idea how to pass those values at the right place.
Thanks for any help.
I'm trying to dynamically filter a Browse form displayed in a tab of an Edit form : Browse form is based on a view and then filter with the pk (prf_id) from the record of the Edit form :
Code: Select all
SELECT * FROM v_liste_suivi_eleve_referent
WHERE lser_referent_id = '#prf_id#'
ORDER BY lser_nom_interne, lser_no_periode, lser_identite ASC
Code: Select all
SELECT DISTINCT lser_nom_interne, lser_nom_interne
FROM v_liste_suivi_eleve_referent
WHERE lser_referent_id = '#RECORD_ID#' ORDER BY lser_nom_interne ASC
On load, the nuFORM.form_data for the Browse form is populated with empty values for the 2 above fields.
How can I pass the values from the Edit form to the nuFORM.form_data of the Browse form with JavaScript and onchange event for each dropdown ?
If it's possible, a click on the Find (Chercher) button will then filter the Browse form according to the values in filter_dd_classes & filter_dd_periode fields.
To do so, I will also need to modify my previous SQL query for the Browse form to something like that :
Code: Select all
SELECT * FROM v_liste_suivi_eleve_referent
WHERE lser_referent_id = '#prf_id#'
AND lser_classe = '#filter_dd_classes#'
AND lser_periode = '#filter_dd_periode#'
ORDER BY lser_nom_interne, lser_no_periode, lser_identite ASC
Thanks for any help.