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
129.03.2003 00:00:0019.03.2003 15:48:4111.03.2003 00:00:00Shipped0Customer requested that FedEx Ground is used for…486 View Edit Remove
218.03.2003 00:00:0024.03.2003 00:00:0020.03.2003 00:00:00Shipped0187 View Edit Remove
325.03.2003 00:00:0031.03.2003 00:00:0030.03.2003 00:00:00Shipped0129 View Edit Remove
424.03.2003 00:00:0003.04.2003 00:00:0029.03.2003 00:00:00Shipped0Customer requested that ad materials (such as…144 View Edit Remove
526.03.2003 00:00:0002.04.2003 00:00:0027.03.2003 00:00:00Shipped0124 View Edit Remove
601.04.2003 00:00:0024.04.2003 00:00:0002.04.2003 00:00:00Shipped0172 View Edit Remove
704.04.2003 00:00:0012.04.2003 00:00:0007.04.2003 00:00:00Shipped0424 View Edit Remove
811.04.2003 00:00:0019.04.2003 00:00:0013.04.2003 00:00:00Shipped0381 View Edit Remove
916.04.2003 00:00:0024.04.2003 00:00:0017.04.2003 00:00:00Shipped0148 View Edit Remove
1021.04.2003 00:00:0029.04.2003 00:00:0026.04.2003 00:00:00Shipped0Customer has worked with some of our vendors in…216 View Edit Remove
Search