Nested Master Detail Datagrid *

* Please note this feature is only available in paid versions.

The master detail datagrid can be nested to show relationships for multilevel hierarchal data. The example shows only three levels, though the number of nested levels can be unlimited.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//suppliers master-detail
$sg = new C_DataGrid("SELECT * FROM suppliers","supplierCode","suppliers");
$sg->set_sql_key("supplierName");

//supplier detail2: products
$sg_d1 = new C_DataGrid("SELECT productCode,productName,productDescription,quantityInStock,MSRP,productVendor FROM products","productCode","products");

//nested grid-level 3 for products
$sg_d1_n1 = new C_DataGrid("SELECT * FROM productparts","productCode","productparts");

//set detail for products
$sg_d1->set_masterdetail($sg_d1_n1, 'productCode');

//set detail 2 for suppliers
$sg->set_masterdetail($sg_d1, 'productVendor');

$sg->display();

Note:
in example, click on #4 on suppliers, then S10_4698 in the first detail grid to reveal the third nested detail grid.
See Live Example!

No related content found.

Tags: , , ,