Skip to content

Commit

Permalink
fix column position and colspan
Browse files Browse the repository at this point in the history
1) Fix `colspan` value in grouping header from `colspans` to `(grp.groupColumnShow[n.idx] === false ? colspans-1 : colspans)`.
2) fix parameters of `buildSummaryTd` in case of `groupSummaryPos: ["header"]` and `groupColumnShow: [false]`. The current implementation places the summary in the old position
  • Loading branch information
OlegKi committed Jul 27, 2014
1 parent 8abcfe2 commit bfe65a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/grid.grouping.js
Expand Up @@ -379,10 +379,10 @@ $.jgrid.extend({
}
if(grp.groupSummaryPos[n.idx] === 'header') {
str += "<tr id=\""+hid+"\"" +(grp.groupCollapse && n.idx>0 ? " style=\"display:none;\" " : " ") + "role=\"row\" class= \"ui-widget-content jqgroup ui-row-"+$t.p.direction+" "+clid+"\"><td style=\"padding-left:"+(n.idx * 12) + "px;"+"\"" + mul +">"+icon+$.jgrid.template(grp.groupText[n.idx], gv, n.cnt, n.summary)+"</td>";
str += buildSummaryTd(i, n.idx-1, grp.groups, (mul ==="") ? 1 : 2 );
str += buildSummaryTd(i, grp.groupColumnShow[n.idx] === false ? n.idx-2 : n.idx-1, grp.groups, grp.groupColumnShow[n.idx] === false ? (mul ==="" ? 2 : 3) : ((mul ==="") ? 1 : 2));
str += "</tr>";
} else {
str += "<tr id=\""+hid+"\"" +(grp.groupCollapse && n.idx>0 ? " style=\"display:none;\" " : " ") + "role=\"row\" class= \"ui-widget-content jqgroup ui-row-"+$t.p.direction+" "+clid+"\"><td style=\"padding-left:"+(n.idx * 12) + "px;"+"\" colspan=\""+colspans+"\">"+icon+$.jgrid.template(grp.groupText[n.idx], gv, n.cnt, n.summary)+"</td></tr>";
str += "<tr id=\""+hid+"\"" +(grp.groupCollapse && n.idx>0 ? " style=\"display:none;\" " : " ") + "role=\"row\" class= \"ui-widget-content jqgroup ui-row-"+$t.p.direction+" "+clid+"\"><td style=\"padding-left:"+(n.idx * 12) + "px;"+"\" colspan=\""+(grp.groupColumnShow[n.idx] === false ? colspans-1 : colspans)+"\">"+icon+$.jgrid.template(grp.groupText[n.idx], gv, n.cnt, n.summary)+"</td></tr>";
}
var leaf = len-1 === n.idx;
if( leaf ) {
Expand Down

0 comments on commit bfe65a3

Please sign in to comment.