Selectbox Grouping Dependency Based on Parent Form Field

Introduction

Learn how to set up a dropdown select box in a grid form that dynamically adjusts its options based on a parent form field's value. This approach is useful for creating dependent or grouped selections in forms, improving performance by limiting the available options based on user inputs.

How does it work?

To achieve dynamic dropdown options based on a parent form field value, follow these steps:

  1. Use a custom HTML script to transfer the value from a parent form field to the child form. This enables the child form to use the parent’s value for filtering options.
    <script>
    $(function(){
        region = window.top.$("input[name='region']:checked").val();
        FormUtil.getField("region").val(region);
    });
    </script>

  2. Utilize the Field ID to control available options based on Grouping attribute in the Select Box configuration. This ensures that the dropdown options are populated according to the value copied from the parent form.
  3. Optimize Performance by filtering the options through the JSON Call Form Options Binder. You can limit the selections dynamically, enhancing performance and relevance.

Download sample app

Download the demo app for Selectbox Grouping Dependency Based on Parent Form Field:
Created by Julieth Last modified by Aadrian on Dec 13, 2024