Gouping summary

QuestionsGouping summary
germanmary asked 9 years ago

hi sir,

How to use number formatter for the grouping summary field.

When i use $col["formater"] Footer Summary or the filter summary is not shown

How to solve this issue.Please help me as early as possible.Its very urgent.
Thank you

11 Answers
Abu Ghufran answered 9 years ago

Try setting footerData last arg to false. e.g.

// 4th arg value of false will disable the using of formatter
grid.jqGrid('footerData','set', {id: 'Total: ' + sum.toFixed(2), invdate: 'Sub Total: '+sum_running, total: 'Grand Total: '+sum_table}, false);

Abu Ghufran answered 9 years ago

Previous reply was for footer row summary.
For grouping, you can have formatting in php code:e.g.

$data["params"]["userdata"] = array("note"=>"Grand Summary","total"=>"Total: $".$total);

Code: http://www.phpgrid.org/demo/demos/appearence/grouping.phps
Demo: http://www.phpgrid.org/demo/demos/appearence/grouping.php

germanmary answered 9 years ago

hi
thank you sir

i have followed the Grouping Example.phpgriddemosappearencegrouping.php

how to apply the solution given by you

germanmary answered 9 years ago

Hi sir

I have used this sample and got the grid also.

I wanted to format the total column to be a currency format .so i tried but got grouping total is not getting calculated because the comma separated value cannot be used to sum.How to do this?

Thank you

germanmary answered 9 years ago

$col = array();
$col["title"] = "Sales Litre ";
$col["name"] = "SALELITER";
$col["editable"] = false;
$col["align"] = "right";
$col["formatter"] = "number";
$col["formatoptions"] = array("thousandsSeparator" => ",",
"decimalSeparator" => ".",
"decimalPlaces" => 2);
$col["sortable"] = false; // this column is not sortable
$col["search"] = false; // this column is not searchable
$col["summaryType"] = "sum"; // available grouping fx: sum, count, min, max, avg
$col["summaryTpl"] = '<b>Sub Total: {0} Ltr</b>'; // display html for summary row – work when "groupSummary" is set true. search below
$testt=$col["summaryTpl"];
$col["hidden"] = false;
$cols[] = $col;

germanmary answered 9 years ago

Thank you sir

for your passion 9494 when i use formatter i dont the the group summary value.

That is my issue.

Thank you

Abu Ghufran answered 9 years ago

Hi,

I don't understand your query. Please explain with more details / code / screenshot.
Please refer the code and compare with your implementation.

Abu Ghufran answered 9 years ago

// $grid["userDataOnFooter"] = true; // Fill footer row with userdata (with on_data_display event)

// to use footerdata without formatter, comment above and use this
$grid["loadComplete"] = 'function(){ var userData = jQuery("#list1").jqGrid("getGridParam","userData"); jQuery("#list1").jqGrid("footerData","set",userData,false); }';

Ruby answered 9 years ago

Sir, I try to see your sample code from http://www.phpgrid.org/demo/demos/appearence/grouping.phps but it appear message that the page not found. Would you fix it?

Your Answer

2 + 6 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?