我将 jqGrid 与 jqPivot 一起使用。
这是我的代码:
$("#pvtCrewAttendance").jqGrid("jqPivot",
data,
{
footerTotals: true,
footerAggregator: "sum",
totals: true,
totalText: "Sumary",
xDimension: [
{ dataName: "CategoryName", label: "Category Name", sortorder: "desc", footerText: "Row total" },
],
yDimension: [
{ dataName: "ProductName", sorttype: "text", totalHeader: "Total in {0}" },
],
aggregates: [
{ member: "ProductName", aggregator: "count" }
]
},
// grid options
{
iconSet: "fontAwesome",
cmTemplate: { autoResizable: true, width: 80 },
shrinkToFit: false,
autoresizeOnLoad: true,
autoResizing: { compact: true },
pager: false,
rowNum: 20,
width: 420,
height: 100,
rowList: [5, 10, 20, 100, "10000:All"],
caption: "Selling statistic"
}
);
这是我的笨拙 演示
我想在最后一列中汇总每个类别的产品数量。
有什么办法吗?