dynamic lookup with operators

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
silr
User
Posts: 1

dynamic lookup with operators

Post by silr »

hi,
I am looking into filtering a field (Field C) dropdown list in add and edit pages so that it is dynamically changed by the values entered in two other fields (Field A - dropdown, Field B - textbox for int value).
Can I do it somehow by using lookup table & parent/filters only, using operators such as <= and >= and not only the default = so that I can compare the Field B values with the required parent bounds and hence filter accordingly the dropdown list for Field C?

Parent/Filter #1
Parent field id_ctr _type
Filter field id_ctr _type

Filters Field C according to Field A with no issues

Parent/Filter #2
Parent field val estimation
Filter field max bound
Parent/Filter #3
Parent field val estimation
Filter field min_bound

These two would require operators so that values can be compared accordingly

I tried modifying the instantiation of the Lookup object with operators, but to no avail:

$this->id_asg_method->Lookup = new Lookup(
    $this->id_asg_method, // Field
    'asg_method',    // Table
    false,        // Distinct
    'id',        // Link field
    ["name","","",""],  // Display fields (only 'name' is needed)
    '',         // Parent fields
    '',         // Child fields
    ["x_id_ctr_type","x_est_value","x_est_value"], // Filter fields
    ["=", ">=", "<="],  // Filter operators
    ["id_ctr_type","min_bound","max_bound"], // Auto fill source fields
    ["x_id_ctr_type","x_min_bound","x_max_bound"], // Auto fill target fields
    [],         // Lookup filters
    [],         // Lookup options
    false,        // Use lookup cache
    '',         // Lookup cache count
    '',         // Lookup order by
    "`name`"       // User select (order by 'name')
);

thanks


arbei
User
Posts: 9786

Post by arbei »

You may try Lookup_Selecting server event.


Post Reply