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
106.11.2003 00:00:0014.11.2003 00:00:0015.11.2003 00:00:00Shipped0324 View Edit Remove
206.11.2003 00:00:0015.11.2003 00:00:0012.11.2003 00:00:00Shipped0386 View Edit Remove
307.11.2003 00:00:0017.11.2003 00:00:0012.11.2003 00:00:00Shipped0344 View Edit Remove
408.11.2003 00:00:0016.11.2003 00:00:0010.11.2003 00:00:00Shipped0Custom shipping instructions sent to warehouse242 View Edit Remove
511.11.2003 00:00:0017.11.2003 00:00:0013.11.2003 00:00:00Cancelled0Customer cancelled due to urgent budgeting…496 View Edit Remove
611.11.2003 00:00:0019.11.2003 00:00:0014.11.2003 00:00:00Shipped0171 View Edit Remove
712.11.2003 00:00:0019.11.2003 00:00:0015.11.2003 00:00:00Shipped0167 View Edit Remove
812.11.2003 00:00:0021.11.2003 00:00:0018.11.2003 00:00:00Shipped0124 View Edit Remove
913.11.2003 00:00:0022.11.2003 00:00:0015.11.2003 00:00:00Shipped0We need to keep in close contact with their…339 View Edit Remove
1014.11.2003 00:00:0022.11.2003 00:00:0020.11.2003 00:00:00Shipped0484 View Edit Remove
Search