【发布时间】:2014-06-22 20:28:10
【问题描述】:
我一定是做错了什么。当我使用 groupSummary true 和 groupSummaryPos 页脚进行分组时,一切似乎都是正确的。
jQuery(function () {
jQuery("#list").jqGrid({
url: "/ballot/ballot/format/xml",
datatype: "xml",
mtype: "POST",
colNames: [],
colModel: [
{ label: 'Committee', name: 'comm', align: 'left' },
{ label: 'Research Area', name: 'resa', align: 'left' },
{ label: 'Program', name: 'prog', align: 'left' },
{ label: 'Project Code', name: 'proj', align: 'left' },
{ label: 'Req\'d 2014 Funding', name: 'freq', align: 'right', formatter: 'currency', formatoptions: {decimalSeparator:".", thousandsSeparator: ",", decimalPlaces: 0, prefix: "$", suffix:"", defaultValue: "0.00"}, summaryType: 'sum' },
{ label: 'Subscription Funds Voted', name: 'vsub', align: 'right', formatter: 'currency', formatoptions: {decimalSeparator:".", thousandsSeparator: ",", decimalPlaces: 0, prefix: "$", suffix:"", defaultValue: "0.00"}, summaryType: 'sum' },
{ label: 'Supplemental Funds Voted', name: 'vsup', align: 'right', formatter: 'currency', formatoptions: {decimalSeparator:".", thousandsSeparator: ",", decimalPlaces: 0, prefix: "$", suffix:"", defaultValue: "0.00"}, summaryType: 'sum' },
{ label: 'Total Funds Voted', name: 'total', align: 'right', formatter: 'currency', formatoptions: {decimalSeparator:".", thousandsSeparator: ",", decimalPlaces: 0, prefix: "$", suffix:"", defaultValue: "0.00"}, summaryType: 'sum' },
{ label: '% Funded', name: 'note', align: 'center', sortable: '', formatter: 'currency', formatoptions: {decimalSeparator:".", thousandsSeparator: " ", decimalPlaces: 1, prefix: "", suffix:"%", defaultValue: "0.00"} },
{ label: 'In-kind Support Voted', name: 'iks', align: 'left' },
{ label: 'Level Of Commitment', name: 'loc', align: 'left' },
{ label: 'Add\'l 2014 Funds Required', name: 'freqadd', align: 'right', formatter: 'currency', formatoptions: {decimalSeparator:".", thousandsSeparator: ",", decimalPlaces: 0, prefix: "$", suffix:"", defaultValue: "0.00"}, summaryType: 'sum' },
{ label: 'Out Years Funding Req\'d', name: 'freqout', align: 'right', formatter: 'currency', formatoptions: {decimalSeparator:".", thousandsSeparator: ",", decimalPlaces: 0, prefix: "$", suffix:"", defaultValue: "0.00"}, summaryType: 'sum' },
{ label: 'Companies Voting', name: 'comps', sortable: '' }
],
pager: "#pager",
rowNum: 20,
height: 300,
viewrecords: true,
gridview: true,
autoencode: true,
caption: "Ballot",
postData: {filterset: jQuery("#filterset").val()},
autowidth: true,
shrinkToFit: false,
grouping: true,
groupingView : {
groupField : ['comm','resa','prog'],
groupOrder : ['asc','asc','asc'],
groupSummary: [true, true, true],
groupColumnShow: [false, false, false],
groupSummaryPos: ['footer', 'footer', 'footer']
}
});
});
这正是我所期望的。 但是,当我将上面的 groupSummaryPos 更改为“header”时,我没有得到预期的结果。 结果右移一列,总数不正确。
以下是所见结果的摘要:
使用“页脚”,我得到了这个(部分)结果
项目代码 Req'd 2014 资金 认购 资金 投票 补充资金 投票 总资金 投票 通讯-0 研究-0 程序-0 项目 1 $1,000 $100 $10 $110 项目 2 $2,000 $200 $20 $220 项目 3 $3,000 $300 $30 $330 项目 4 $4,000 $400 $40 $440 项目 5 $5,000 $500 $50 $550 $15,000 $1,500 $150 $1,650-Program-0 的摘要页脚 程序一 项目 6 $6,000 $600 $60 $660 项目 7 $7,000 $700 $70 $770 项目 8 $8,000 $800 $80 $880 项目 9 $9,000 $900 $90 $990 项目-10 $10,000 $1,000 $100 $1,100 $40,000 $4,000 $400 $4,400-Program-1 的摘要页脚 $55,000 $5,500 $550 $6,050-Research-0 的摘要页脚使用“标题”,我得到了这个(部分)结果
项目代码 Req'd 2014 资金 认购 资金 投票 补充资金 投票 总资金 投票 Comm-0 $210,000 $21,000 $2,100 $23,100 Research-0 $55,000 $5,500 $550 $6,050-Research-0 总结 Program-0 $55,000 $5,500 $550 $6,050-Program-0 总结 项目 1 $1,000 $100 $10 $110 项目 2 $2,000 $200 $20 $220 项目 3 $3,000 $300 $30 $330 项目 4 $4,000 $400 $40 $440 项目 5 $5,000 $500 $50 $550 计划 1 55,000 美元 5,500 美元 550 美元 6,050 美元 - 计划 1 总结 项目 6 $6,000 $600 $60 $660 项目 7 $7,000 $700 $70 $770 项目 8 $8,000 $800 $80 $880 项目 9 $9,000 $900 $90 $990 项目-10 $10,000 $1,000 $100 $1,000关于为什么标题摘要似乎不起作用的任何想法?
【问题讨论】:
标签: jquery jquery-plugins jqgrid