StringBuilder buf = new StringBuilder();
int last = cs.size() - 1;
for (int i = 0, len = cs.size(); i < len; i++) {
ColumnData c = cs.get(i);
SummaryColumnConfig cf = (SummaryColumnConfig) cm.getColumn(i);
Params p = new Params();
p.set("id", c.id);
p.set("style", c.style);
String css = i == 0 ? "x-grid3-cell-first " : (i == last ? "x-grid3-cell-last " : "");
p.set("css", css);
if (cf.getSummaryFormat() != null) {
p.set("value", cf.getSummaryFormat().format(((Number) data.get(c.name)).doubleValue()));
} else if (cf.getSummaryRenderer() != null) {
p.set("value", cf.getSummaryRenderer().render(data.get(c.name), data));
} else {
p.set("value", data.get(c.name));
}
buf.append(cellTpl.applyTemplate(p));
}
Params rp = new Params();
rp.set("tstyle", "width:" + getTotalWidth() + "px;");
rp.set("cells", buf.toString());
return rowTpl.applyTemplate(rp);
}