summary on griid

Questionssummary on griid
juliano gomes weber asked 6 years ago

Can i make the summary with total, average, etc… in footer of grid?

1 Answers
Abu Ghufran answered 6 years ago

Pasted from FAQs, let me know for more help.

##### Q) How to enable footer summary row?

Please do these changes to enable footer summary row.

Step1: Enable footer row in options

$grid["footerrow"] = true;

$g->set_options($grid);

Step2: Add custom JS code as mentioned. 'list1' is the identifier for grid. In function 'getCol', 2nd param 'field1' is the name of column, which will show the summary data. Valid options for mathoperation (4th param) are – 'sum, 'avg', 'count'.

<div style="margin:0px;">
<script>
var opts = {

'loadComplete': function () {
var grid = $("#list1"),
sum = grid.jqGrid('getCol', 'field1', false, 'sum');
grid.jqGrid('footerData','set', {field1: 'Total: '+sum});
}
};
</script>

<?php echo $out?>
</div>

Your Answer

14 + 8 =

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 / 5. Vote count:

As you found this post useful...

Follow us on social media!

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

Let us improve this post!