Databases Reference
In-Depth Information
The drop-down list of foreign keys
Displaying the book table, in Insert mode (or in Edit mode), there is now a
drop-down list of the possible keys for each column that has a defined relation.
The list contains the keys and the description (display column) in both orders—key
to the display column as well as display column to the key. This enables us to use the
keyboard and type the first letter of either the key or the display column.
Only the key (in this case 1 ) will be stored in the book
table. The display column is shown only to assist us.
By default, this drop-down list will appear if there are a maximum of 100 rows in the
foreign table. This is controlled by the following parameter:
$cfg['ForeignKeyMaxLimit'] = 100;
For foreign tables bigger than that, a distinct window appears—the foreign-table
window (refer to the next section) that can be browsed.
We might prefer to see information differently in the drop-down list. Here, John
Smith is the content and 1 is the ID. The default display is controlled by the
following line of code:
$cfg['ForeignKeyDropdownOrder'] = array( 'content-id', 'id-content');
We can use one or both of the strings— content-id and id-content —in the defining
array and in the order we prefer. Thus, defining $cfg['ForeignKeyDropdownOrder']
to array('id-content') would produce a list with only those choices:
1 - John Smith
2 - Maria Sunshine
3 - André Smith
 
Search WWH ::




Custom Search