Master-details relationships are commonly used in applications.
An example of this type of relationship is an order with a header
and line items. In PHPRunner you can join, or link, two or more
tables that have at least one common field. You can Add/Edit
records in the master-details tables on the same page.
Note that one master table can have multiple details tables. And
you can display data from multiple details tables (nested or one
master - many details) on the same page. I.e. you can display customers,
orders by customer, order details per order and edit all three
tables at the same time without leaving the page.
To create master-details relationship in PHPRunner:
1. Go to the Datasource
tables page and select both master and details tables in the
list of datasource tables..
2. Drag field from one table to another. Table link properties dialog opens.
3. Choose what table is Master and select link fields in both
tables. If you'd like to display master table data on the details
page select the corresponding check box. Click OK.
See examples of Master and Details settings below.
Show single link
for all details:
Link for details is displayed as
icon. Click it to view details tables. Use
this option if master table has multiple details tables.
Preview details records in
Note: If you
select to display details records in popup, you can define the
popup page appearance in Visual
Editor -> Details
preview page for details table.
Preview details records
If you select to display details records inline, you will be
able to add/edit/delete details in inline mode on master table.
Display details records on the
Display master table data on
the details page:
4. Now master-details relationship is created and displayed as
arrow between tables.
of child tables
If master table has two or more details tables, you can re-order
details tables as well as choose orientation (vertical or
horizontal). To do so right click a link between tables and choose
"Detail tables ordering".
For more information, see Master-details
table data with details
You can print the master table data on the List page with data
from details tables.
Example of page to be printed:
Charts and reports as
master and details tables
Now you can use charts and reports as both master and details
Chart as details table:
Chart as master table:
Report as details table: