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 (5 items)
1141JN35528049539.37
2141JN72201041206.2
3141KT5257863843.55
4141MC4694635420.74
5141NU62770626155.91
total216165.77
144 (2 items)
6144IR84630336005.71
7144LA6856787674.94
total43680.65
145 (3 items)
8145CN3285454710.73
9145HR18268820564.86
10145JJ24639153959.21
total79234.8
Search