Nested tables

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

#OrderdateRequireddateShippeddateStatusActionCommentsCustomernumber
Actions
111.09.2003 00:00:0026.09.2003 00:00:0021.09.2003 00:00:00Not Shipped0They want to reevaluate their terms agreement…148 View Edit Remove
221.09.2003 00:00:0030.09.2003 00:00:0024.09.2003 00:00:00Shipped0311 View Edit Remove
310.10.2003 00:00:0019.10.2003 00:00:0016.10.2003 00:00:00Shipped0321 View Edit Remove
411.10.2003 00:00:0017.10.2003 00:00:0017.10.2003 00:00:00Shipped0347 View Edit Remove
517.10.2003 00:00:0025.10.2003 00:00:0020.10.2003 00:00:00Shipped0227 View Edit Remove
618.10.2003 00:00:0026.10.2003 00:00:0019.10.2003 00:00:00Shipped0321 View Edit Remove
720.10.2003 00:00:0027.10.2003 00:00:0024.10.2003 00:00:00Shipped0424 View Edit Remove
821.10.2003 00:00:0030.10.2003 00:00:0023.10.2003 00:00:00Resolved0This order was disputed, but resolved on…452 View Edit Remove
922.10.2003 00:00:0031.10.2003 00:00:0026.12.2003 00:00:00Shipped0This order was on hold because customers's credit…148 View Edit Remove
1021.10.2003 00:00:0030.10.2003 00:00:0027.10.2003 00:00:00Shipped0462 View Edit Remove
Search