Page 1 of 1

Select Cascade v4

Posted: Thu Nov 08, 2018 2:01 pm
by vanman
Hi

Has the dropdown cascade changed between v3 and v4?

I am struggling to make it work

I have a dropdown project_id from project table and in project_item table I need to select all project items that refer to the previous dropdown on project_id, tra_project_id is in the project_item table..

Thanks for help

Paul

Re: Select Cascade v4

Posted: Thu Nov 08, 2018 10:50 pm
by admin
Welcome back mate,

If you use Lookups instead of Dropdowns there are 3 advantages...

1. A Lookup can handle a project list that keeps growing.
2. A Dropdown Object requires that everything in the list to be copied to the browser (from the server) everytime an Edit Form is displayed - not good for big lists.
3. Using a Lookup for project items allows you to create a list that can be filtered automatically once you have chosen your project - by using a Hash Cookie in the project items' SQL statement of the Lookup. eg.

Code: Select all

SELECT * FROM project_item WHERE ite_project_id = '#cus_project_id#'
This SQL is the SQL property of the Form used in the project items' Lookup.

https://wiki.nubuilder.cloud/ ... /Forms#SQL

https://wiki.nubuilder.cloud/ ... Custom_SQL

Paul, I hope this helps.

BTW if you still want to use Dropdowns, you can but it would require some tricky Javascript.


Steven

Re: Select Cascade v4

Posted: Fri Nov 09, 2018 5:29 am
by ARWEN
To use cascaded dropdowns, there is a good example that uses a PHP procedure

https://forums.nubuilder.cloud/viewtopic. ... ded#p15400

Re: Select Cascade v4

Posted: Fri Nov 09, 2018 6:26 am
by vanman
Thanks Steven

Re: Select Cascade v4

Posted: Fri Nov 09, 2018 9:51 pm
by admin
.