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 
2122 (2 items)
12122MA7245622520025.11
22122AU3641010136251.03
total556276.14
141 (8 items)
3141DB58321636140.38
4141DL46061846895.48
5141HJ3268659830.55
6141ID10962116208.4
7141IN44625865071.26
8141JE105477120166.58
9141JN35528049539.37
10141JN72201040206.2
total534058.22
Search