Nested tables in tabs Default 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 | 20.10.2003 00:00:00 | 27.10.2003 00:00:00 | 24.10.2003 00:00:00 | Shi | ffdfd | 424 | View Edit Remove |
| 2 | 21.10.2003 00:00:00 | 30.10.2003 00:00:00 | 23.10.2003 00:00:00 | Shipped | Questo ordine è stato contestato, ma risolto | 452 | View Edit Remove |
| 3 | 22.10.2003 00:00:00 | 31.10.2003 00:00:00 | 26.12.2003 00:00:00 | Shipped | This order was on hold because customers's credit | 148 | View Edit Remove |
| 4 | 21.10.2003 00:00:00 | 30.10.2003 00:00:00 | 27.10.2003 00:00:00 | Shipped | 462 | View Edit Remove | |
| 5 | 23.10.2003 00:00:00 | 30.10.2003 00:00:00 | Cancelled | Customer called to cancel. The warehouse was | 448 | View Edit Remove | |
| 6 | 28.10.2003 00:00:00 | 03.11.2003 00:00:00 | 01.11.2003 00:00:00 | Shipped | 161 | View Edit Remove | |
| 7 | 04.11.2003 00:00:00 | 14.11.2003 00:00:00 | 09.11.2003 00:00:00 | Shipped | 276 | View Edit Remove | |
| 8 | 04.11.2003 00:00:00 | 12.11.2003 00:00:00 | 07.11.2003 00:00:00 | Shipped | 452 | View Edit Remove | |
| 9 | 05.11.2003 00:00:00 | 13.11.2003 00:00:00 | 07.11.2003 00:00:00 | Shipped | 233 | View Edit Remove | |
| 10 | 05.11.2003 00:00:00 | 14.11.2003 00:00:00 | 11.11.2003 00:00:00 | Shipped | 175 | View Edit Remove |