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 
141 (8 items)
1141ID10962116208.4
2141IN44625865071.26
3141JE105477120166.58
4141JN35528049539.37
5141JN72201040206.2
6141KT5257863843.55
7141MC4694635420.74
8141NU62770626155.91
total516612.01
144 (2 items)
9144IR84630336005.71
10144LA6856787674.94
total43680.65
Search