jqgrid summary tpl with group name

4.6k views Asked by At

Is it possible to display row group summary text with group Value.. As shown in above, I want to set text "total" As "Gwadar-Total" and so on.

How can I achieve this at run time, which get Text from row group and display with summary Text?

I am using "summaryTpl" in cell modal.

2

There are 2 answers

0
Sourabh Mazumder On

Try this

$('#gridName tr[jqfootlevel="0"] td').each(function () {
  $(this).html($(this).html().replace('Total','Main Group Level Total'));
}); 
0
aramadhani On

from http://www.trirand.com/jqgridwiki/doku.php?id=wiki:grouping you can use custom summaryType

function mysum(val, name, record)
{
return parseFloat(val||0) + parseFloat((record[name]||0));
}

jQuery("#grid").jqGrid({ 
...
colModel : [
    {..},
    {name:'amount',index:'amount', width:80, align:"right", sorttype:'number',formatter:'number',summaryType:mysum},
       ...
 ],
 ...
});

regards,

aramadhani