Field Grouping

Simple column grouping, summation of a column value and inline editing.


public function field_grouping()
{
  $xcrud = get_xcrud();
  $xcrud->table('payments');
  $xcrud->unset_remove();
  $xcrud->group_by_columns('customerNumber');//Allows only one field
  $xcrud->group_sum_columns('amount');//Allows only one field
  $xcrud->columns('customerNumber,checkNumber,amount');
  $xcrud->fields_inline('customerNumber,checkNumber,paymentDate,amount');
    
  $data['content'] = $xcrud->render();
  
  return view('demos', $data);
}

Payments

#CustomernumberChecknumberAmount 
129 (1 items)
1129PI4299116537.85
total16537.85
131 (2 items)
2131CL44270522292.62
3131MA72456250025.35
total72317.97
141 (7 items)
4141AU36410136251.03
5141DB58321636140.38
6141DL46061846895.48
7141HJ3268659830.55
8141ID10962116208.4
9141IN44625865071.26
10141JE105477120166.58
total480563.68
Search