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 
131 (2 items)
1131CL44270522292.62
2131MA72456250025.35
total72317.97
141 (8 items)
3141AU36410136251.03
4141DB58321636140.38
5141DL46061846895.48
6141HJ3268659830.55
7141ID10962116208.4
8141IN44625865071.26
9141JE105477120166.58
10141JN35528049539.37
total530103.05
Search