Nested tables in tabs Bootstrap 5 theme
Example of table nesting in tabs implementation
HIDE CODE
<?php $xcrud = Xcrud::get_instance(); $xcrud->table('orders'); $xcrud->default_tab('Order info'); $xcrud->title_columns("<span style='border: 1px solid #e5e5e5; padding: 5px; display: block; margin-bottom: 6px;'><b> Order Number: {orderNumber}</b><br><b> Customer Number: {customerNumber}</b></span>"); $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'); $orderdetails->order_by("productCode","asc"); //$orderdetails->limit(1000); $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(); ?> <script> $('.xcrud-tabs .menu .item').tab('change tab','tab1.php'); </script>
Orders
# | Orderdate | Requireddate | Shippeddate | Status | Comments | Customernumber | |
---|---|---|---|---|---|---|---|
1 | 28.05.2003 00:00:00 | 07.06.2003 00:00:00 | 02.06.2003 00:00:00 | Shipped | 458 | View Edit Remove | |
2 | 03.06.2003 00:00:00 | 09.06.2003 00:00:00 | 06.06.2003 00:00:00 | Not Shipped | Customer requested special shippment. The | 151 | View Edit Remove |
3 | 06.06.2003 00:00:00 | 12.06.2003 00:00:00 | 11.06.2003 00:00:00 | Shipped | 141 | View Edit Remove | |
4 | 12.06.2003 00:00:00 | 18.06.2003 00:00:00 | 14.06.2003 00:00:00 | Shipped | 324 | View Edit Remove | |
5 | 16.06.2003 00:00:00 | 24.06.2003 00:00:00 | 21.06.2003 00:00:00 | Shipped | 198 | View Edit Remove | |
6 | 16.06.2003 00:00:00 | 25.06.2003 00:00:00 | 21.06.2003 00:00:00 | Shipped | 447 | View Edit Remove | |
7 | 25.06.2003 00:00:00 | 01.07.2003 00:00:00 | 28.06.2003 00:00:00 | Shipped | 323 | View Edit Remove | |
8 | 27.06.2003 00:00:00 | 04.07.2003 00:00:00 | 03.07.2003 00:00:00 | Shipped | 141 | View Edit Remove | |
9 | 01.07.2003 00:00:00 | 10.07.2003 00:00:00 | 05.07.2003 00:00:00 | Shipped | 250 | View Edit Remove | |
10 | 02.07.2003 00:00:00 | 12.07.2003 00:00:00 | 03.07.2003 00:00:00 | Shipped | 124 | View Edit Remove |