Nested tables

Example of table nesting.


public function nested_tables()
{
  $xcrud = get_xcrud();
  $xcrud->table('orders');
  $xcrud->default_tab('Order info');
  
  $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
    
  $data['content'] = $xcrud->render();
  
  return view('demos', $data);
}

Orders

#OrderdateRequireddateShippeddateStatusCommentsCustomernumber 
108.05.2003 00:00:0013.05.2003 00:00:0013.05.2003 09:14:44Shipped mmm353
208.05.2003 00:00:0016.05.2003 00:00:0013.05.2003 00:00:00Shipped350
320.05.2003 00:00:0029.05.2003 00:00:0022.05.2003 00:00:00Shipped103
421.05.2003 00:00:0029.05.2003 00:00:0025.05.2003 00:00:00ShippedCustomer very concerned about the exact color of…112
521.05.2003 00:00:0027.05.2003 00:00:0024.05.2003 00:00:00Shipped114
628.05.2003 00:00:0007.06.2003 00:00:0002.06.2003 00:00:00Shippedegehg458
703.06.2003 00:00:0009.06.2003 00:00:0006.06.2003 00:00:00ShippedCustomer requested special shippment. The…151
806.06.2003 00:00:0012.06.2003 00:00:0011.06.2003 00:00:00Shipped141
912.06.2003 00:00:0018.06.2003 00:00:0014.06.2003 00:00:00Shipped324
1016.06.2003 00:00:0024.06.2003 00:00:0021.06.2003 00:00:00Shipped198
Search