Hi ,
I am developing an application using kendoui grid,and i am facing a problem
when grouping the records according to different columns.
I want to have records grouped by name column and at the same time have footerTemplate and groupFooterTemplate for quantity column.
When i add another column on grouping i get an error 'sum is not defined'.
I have looked around on kendo forums, and even the following forum topic:
http://www.kendoui.com/forums/ui/grid/groupable-aggregates-and-groupfootertemplate-problems.aspx
doesn't resolve me the problem.(which looks me more similar to my problem).
I am putting the columns,group,aggregates and fields using php variables:
$arr=array(array('field'=>'pol','title'=>'Part Number','width'=>'200px','aggregates'=> "count", 'groupHeaderTemplate'=> "Part Number: #=value#"),
array('field'=>'name','title'=>'PO ','aggregates'=> "count", 'groupHeaderTemplate'=> "PO Teknema: #=value#"),
array('field'=>'po_supp','title'=>'PO Supplier','aggregates'=> "count", 'groupHeaderTemplate'=> "PO Supplier: #=value#"),
array('field'=>'seltc','title'=>'Quantity Received','aggregates'=> "count", 'groupHeaderTemplate'=> "Quantity Received: #=value#"),
array('field'=>'pol_qty','title'=>'Qty to Receive','aggregates'=> "sum", 'footerTemplate'=> "Total Sum: #=sum#",'groupFooterTemplate'=> "Sum: #=sum#" ),
array('field'=>'qty_purchased','title'=>'Total Qty','aggregates'=> "count", 'groupHeaderTemplate'=> "Total Qty: #=value#"),
//array('field'=>'prod_name','title'=>'Part Number'),
array('field'=>'rif_ordine','title'=>'Rif.Ordine','aggregates'=> "count", 'groupHeaderTemplate'=> "Rif.Ordine: #=value#"),
array('field'=>'project','title'=>'Project','aggregates'=> "count", 'groupHeaderTemplate'=> "Project: #=value#"),
array('field'=>'po_ref','title'=>'PO Reference','aggregates'=> "count", 'groupHeaderTemplate'=> "PO Reference: #=value#"),
);
$columns=json_encode($arr);
$arr=array(
'pol'=>array('type'=>'string'),
'name'=>array('type'=>'string'),
'po_supp'=>array('type'=>'string'),
'seltc'=>array('type'=>'string'),
'pol_qty'=>array('type'=>'number'),
'qty_purchased'=>array('type'=>'number'),
//'prod_name'=>array('type'=>'string'),
'rif_ordine'=>array('type'=>'string'),
'project'=>array('type'=>'string'),
'po_ref'=>array('type'=>'string'),
);
$fields=json_encode($arr);
$arr=array('field'=>'name',
'aggregates'=>array(
array('field'=>'pol','aggregate'=>'count'),
array('field'=>'name','aggregate'=>'count'),
array('field'=>'po_supp','aggregate'=>'count'),
array('field'=>'seltc','aggregate'=>'count'),
array('field'=>'pol_qty','aggregate'=>'sum'),
array('field'=>'qty_purchased','aggregate'=>'count'),
array('field'=>'rif_ordine','aggregate'=>'count'),
array('field'=>'project','aggregate'=>'count'),
array('field'=>'po_ref','aggregate'=>'count'),
)
);
$group=json_encode($arr);
$arr=array(
array('field'=>'pol','aggregate'=>'count'),
array('field'=>'po_supp','aggregate'=>'count'),
array('field'=>'seltc','aggregate'=>'count'),
array('field'=>'pol_qty','aggregate'=>'sum'),
array('field'=>'qty_purchased','aggregate'=>'count'),
array('field'=>'rif_ordine','aggregate'=>'count'),
array('field'=>'project','aggregate'=>'count'),
array('field'=>'po_ref','aggregate'=>'count'),
);
$aggregate=json_encode($arr);
and then pass these variables on js
Please Help me to solve the problem.
Thanks in advance
I am developing an application using kendoui grid,and i am facing a problem
when grouping the records according to different columns.
I want to have records grouped by name column and at the same time have footerTemplate and groupFooterTemplate for quantity column.
When i add another column on grouping i get an error 'sum is not defined'.
I have looked around on kendo forums, and even the following forum topic:
http://www.kendoui.com/forums/ui/grid/groupable-aggregates-and-groupfootertemplate-problems.aspx
doesn't resolve me the problem.(which looks me more similar to my problem).
I am putting the columns,group,aggregates and fields using php variables:
$arr=array(array('field'=>'pol','title'=>'Part Number','width'=>'200px','aggregates'=> "count", 'groupHeaderTemplate'=> "Part Number: #=value#"),
array('field'=>'name','title'=>'PO ','aggregates'=> "count", 'groupHeaderTemplate'=> "PO Teknema: #=value#"),
array('field'=>'po_supp','title'=>'PO Supplier','aggregates'=> "count", 'groupHeaderTemplate'=> "PO Supplier: #=value#"),
array('field'=>'seltc','title'=>'Quantity Received','aggregates'=> "count", 'groupHeaderTemplate'=> "Quantity Received: #=value#"),
array('field'=>'pol_qty','title'=>'Qty to Receive','aggregates'=> "sum", 'footerTemplate'=> "Total Sum: #=sum#",'groupFooterTemplate'=> "Sum: #=sum#" ),
array('field'=>'qty_purchased','title'=>'Total Qty','aggregates'=> "count", 'groupHeaderTemplate'=> "Total Qty: #=value#"),
//array('field'=>'prod_name','title'=>'Part Number'),
array('field'=>'rif_ordine','title'=>'Rif.Ordine','aggregates'=> "count", 'groupHeaderTemplate'=> "Rif.Ordine: #=value#"),
array('field'=>'project','title'=>'Project','aggregates'=> "count", 'groupHeaderTemplate'=> "Project: #=value#"),
array('field'=>'po_ref','title'=>'PO Reference','aggregates'=> "count", 'groupHeaderTemplate'=> "PO Reference: #=value#"),
);
$columns=json_encode($arr);
$arr=array(
'pol'=>array('type'=>'string'),
'name'=>array('type'=>'string'),
'po_supp'=>array('type'=>'string'),
'seltc'=>array('type'=>'string'),
'pol_qty'=>array('type'=>'number'),
'qty_purchased'=>array('type'=>'number'),
//'prod_name'=>array('type'=>'string'),
'rif_ordine'=>array('type'=>'string'),
'project'=>array('type'=>'string'),
'po_ref'=>array('type'=>'string'),
);
$fields=json_encode($arr);
$arr=array('field'=>'name',
'aggregates'=>array(
array('field'=>'pol','aggregate'=>'count'),
array('field'=>'name','aggregate'=>'count'),
array('field'=>'po_supp','aggregate'=>'count'),
array('field'=>'seltc','aggregate'=>'count'),
array('field'=>'pol_qty','aggregate'=>'sum'),
array('field'=>'qty_purchased','aggregate'=>'count'),
array('field'=>'rif_ordine','aggregate'=>'count'),
array('field'=>'project','aggregate'=>'count'),
array('field'=>'po_ref','aggregate'=>'count'),
)
);
$group=json_encode($arr);
$arr=array(
array('field'=>'pol','aggregate'=>'count'),
array('field'=>'po_supp','aggregate'=>'count'),
array('field'=>'seltc','aggregate'=>'count'),
array('field'=>'pol_qty','aggregate'=>'sum'),
array('field'=>'qty_purchased','aggregate'=>'count'),
array('field'=>'rif_ordine','aggregate'=>'count'),
array('field'=>'project','aggregate'=>'count'),
array('field'=>'po_ref','aggregate'=>'count'),
);
$aggregate=json_encode($arr);
and then pass these variables on js
Please Help me to solve the problem.
Thanks in advance