tonytomov / jqGrid

jQuery grid plugin

Home Page:www.trirand.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unconsistente behaivor on `summaryTpl` and `groupText`

PaolaRuby opened this issue · comments

On groupText i can use another cols, but if i try the same on summaryTpl it gives me undefined
How can i achieve the same result on both??

Maybe is a bug or it is not supported and could be a new feature

Using: jqGrid JS - v5.7.0
image
DEMO: https://jsfiddle.net/yLzmop75/1/

///
colModel: [
   ///
   { 'name': 'col', summaryType:'sum', summaryTpl:'<b>{0} - {group_name}</b>' }, // get undefined
],
grouping: true,
groupingView: {
  groupField: ['group'],
  groupText:["{0} - <b>{group_name}</b>"], // it works
  ///

Hi again,

-tmpdata= "<td "+$t.formatCol(k,1,'')+">"+$.jgrid.template(tplfld, vv, fdata.cnt, fdata.dataIndex, fdata.displayValue)+ "</td>";
+tmpdata= "<td "+$t.formatCol(k,1,'')+">"+$.jgrid.template(tplfld, vv, fdata.cnt, fdata.dataIndex, fdata.displayValue, fdata.summary)+ "</td>";

tmpdata= "<td "+$t.formatCol(k,1,'')+">"+$.jgrid.template(tplfld, vv, fdata.cnt, fdata.dataIndex, fdata.displayValue)+ "</td>";

looks like adding fdata.summary on that line fix the problem
image
DEMO: https://jsfiddle.net/nh9a7xo2/

Thanks for look at this.
With your solution you can attach fields only if they have summaryTpl property. Any field without this property can't be set.
Instead of this I will include your solution.

Thank you.

Thanks
Of course, only when they have summary property, same functionality as groupText