summary on griid

Questionssummary on griid
juliano gomes weber asked 11 years ago

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

1 Answers
Abu Ghufran answered 11 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

2 + 17 =

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?