Footer sumary not working

QuestionsFooter sumary not working
Thomas Hofmann asked 7 years ago

Hi together,

I have already finished a grid with time calculation. everything's working fine. Now I try to Display a total sum of one col in the footer.

my code is like this:

$g->select_command = "
SELECT ENT_Zeit.id, ENT_Zeit.sachbearbeiter_id,
ENT_Zeit.bericht_id, ENT_Zeit.datum,
ENT_Zeit.von, ENT_Zeit.bis,
SEC_TO_TIME( UNIX_TIMESTAMP( bis ) – UNIX_TIMESTAMP( von) ) AS zeit,
(SELECT sum(zeit) from ENT_Zeit) as zeit_gesamt
FROM ENT_Zeit
where bericht_id = '" . $var_id . "'";
$g->table = "ENT_Zeit";

>> this SQL Statement works fine. I want to get a sumary of the calculated COL "zeit". I have added an SQL Statement für building a total sumary in SQL "zeit_gesamt"

>> then I added this code
$e["js_on_load_complete"] = "grid_onload";
$g->set_events($e);

<script>
function grid_onload()
{
var grid = $("hpcBerichtZeit"),
sum = grid.jqGrid('getCol', 'zeit_gesamt');
grid.jqGrid('footerData','set', {total: 'Summe: '+sum[0]});

};
</script>

>> No Data is Displayed in Footer. If I use "$grid->set_events($e);", as it is written in all Demos, the Website is unable to load.

thank you for any notice

1 Answers
Abu Ghufran answered 7 years ago

Hello Thomas,

Please share you full code for review.
You can post code at pastebin.com and share the link OR email me at [email protected]

Your Answer

4 + 1 =

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?