1
我有一個jqgrid,具有3個級別的分組,如圖所示。 我需要爲account
列上的每個組添加摘要,如圖中所示。 Jqgrid:Multi Level Group Summary
ColModel
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