Skip to content

How do I make lookup fields (id fields referencing to other table) make dropdown from other table?

You can use values from a database lookup table to bind the drop-down. Simply pass SELECT statement for the $keyvalue_pair when the $ctrl_type is “select”. For example:

$dg -> set_col_edittype("officeCode", "select", "Select officeCode,city from offices",false);

For details: https://phpgrid.com/documentation/set_col_edittype/

Feedback and Knowledge Base