Nested tables Bootstrap 4.5 theme
Example of table nesting
HIDE CODE
<?php $xcrud = Xcrud::get_instance(); $xcrud->table('orders'); $xcrud->default_tab('Order info'); $xcrud->parsley_active(true); //Make extension mandatory $xcrud->set_attr('comments',array('required'=>'required')); $orderdetails = $xcrud->nested_table('Order details','orderNumber','orderdetails','orderNumber'); // 2nd level $orderdetails->columns('productCode,quantityOrdered,priceEach'); $orderdetails->fields('productCode,quantityOrdered,priceEach'); $orderdetails->default_tab('Detail information'); $customers = $xcrud->nested_table('Customers','customerNumber','customers','customerNumber'); // 2nd level 2 $customers->columns('customerName,city,country'); $products = $orderdetails->nested_table('Products','productCode','products','productCode'); // 3rd level $products->default_tab('Product details'); $productLines = $products->nested_table('Product Lines','productLine','productlines','productLine'); // 4th level echo $xcrud->render(); ?>
Orders
# | Orderdate | Requireddate | Shippeddate | Status | Action | Comments | Customernumber | |
---|---|---|---|---|---|---|---|---|
1 | 27.01.2025 00:00:00 | 30.01.2025 00:00:00 | Shipped | 0 | 353 | View Edit Remove | ||
2 | 16.07.2003 00:00:00 | 23.07.2003 00:00:00 | 21.07.2003 00:00:00 | Shipped | 0 | 282 | View Edit Remove | |
3 | 24.07.2003 00:00:00 | 02.08.2003 00:00:00 | 30.07.2003 00:00:00 | Shipped | 0 | 161 | View Edit Remove | |
4 | 08.08.2003 00:00:00 | 16.08.2003 00:00:00 | 13.08.2003 00:00:00 | Shipped | 0 | 124 | View Edit Remove | |
5 | 10.08.2003 00:00:00 | 18.08.2003 00:00:00 | 12.08.2003 00:00:00 | Shipped | 0 | Can we deliver the new Ford Mustang models by | 320 | View Edit Remove |
6 | 03.09.2003 00:00:00 | 13.09.2003 00:00:00 | 06.09.2003 00:00:00 | Shipped | 0 | 447 | View Edit Remove | |
7 | 05.09.2003 00:00:00 | 12.09.2003 00:00:00 | 09.09.2003 00:00:00 | Shipped | 0 | 379 | View Edit Remove | |
8 | 11.09.2003 00:00:00 | 21.09.2003 00:00:00 | 15.09.2003 00:00:00 | Shipped | 0 | They want to reevaluate their terms agreement | 276 | View Edit Remove |
9 | 12.09.2003 00:00:00 | 18.09.2003 00:00:00 | 17.09.2003 00:00:00 | Shipped | 0 | 487 | View Edit Remove | |
10 | 19.09.2003 00:00:00 | 27.09.2003 00:00:00 | 21.09.2003 00:00:00 | Shipped | 0 | They want to reevaluate their terms agreement | 148 | View Edit Remove |