我有一个jqgrid,具有3个级别的分组,如图所示。我需要为account
图像上的列中的每个组添加摘要。
彩色模型
colModel:[
{name:'typeId', jsonmap : 'cell.typeId', width:'100', hidden:true},
{name:'typeName', jsonmap : 'cell.typeName', width:'100', hidden:true, summaryType:nameSummary},
{name:'classId', jsonmap : 'cell.classId', width:'100', hidden:true},
{name:'className', jsonmap : 'cell.className', width:'100', hidden:true, summaryType:nameSummary},
{name:'groupId', jsonmap : 'cell.groupId', width:'100', hidden:true},
{name:'groupName', jsonmap : 'cell.groupName', width:'150', hidden:true, summaryType:nameSummary},
{name:'accountCode', jsonmap : 'cell.accountCode', width:'75'},
{name:'accountName', jsonmap : 'cell.accountName', width:'460'},
{name:'openingBalance', jsonmap : 'cell.openingBalance', width:'110', align:"right", formatter:amountFormatter, summaryType:'sum'},
{name:'debitTotal', jsonmap : 'cell.debitTotal', width:'110', align:"right", formatter:amountFormatter, summaryType:'sum'},
{name:'creditTotal', jsonmap : 'cell.creditTotal', width:'110', align:"right", formatter:amountFormatter, summaryType:'sum'},
{name:'closingBalance', jsonmap : 'cell.closingBalance', width:'110', align:"right", formatter:numberFormatter, summaryType:'sum'}
],
分组选项
grouping: true,
groupingView : {
groupField : ['typeId','classId','groupId'],
groupText : ['<div style="background: none repeat scroll 0 0 #307ECC; color:white; font-size : 16px;" class="ui-jqgrid-titlebar ui-widget-header"><b> {typeName} </b></div>',
'<div style="background-color: #E0ECF8; font-size : 14px;" class="">{className}</div>',
'<div style="font-size : 13px;"><b> {groupName} </b></div>'],
groupCollapse : false,
groupOrder: ['asc','asc','asc'],
groupColumnShow: [false,false,false],
groupSummary : [true, true, true]
},
我怎样才能做到这一点?我正在使用jQuery jqGrid v4.5.2
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句