Unconsistente behaivor on `summaryTpl` and `groupText`
PaolaRuby opened this issue · comments
PaolaRuby commented
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
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
///
PaolaRuby commented
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>";
Line 346 in 10bca9a
looks like adding
fdata.summary
on that line fix the problemDEMO: https://jsfiddle.net/nh9a7xo2/
Tony Tomov commented
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.
PaolaRuby commented
Thanks
Of course, only when they have summary property, same functionality as groupText