1
Help for ParamQuery Pro / Excluding row data in Group Totals
« on: February 01, 2025, 01:29:58 am »
Is there a way to exclude certain rows (based on a column value) in the Group total calculation?
For example - I have a grid result that has budget (in yellow) and transaction data (in black). I do not want the budget amounts in the Group total calculation (see attached screen shot).
Below is my javascript code:
dataModelTransaction= {
location: "remote",
dataType: "jsonp",
method: "GET",
url: "/CCRSearch/Reports/[email protected]",
}
colModelTransaction = [
{ dataIndx: 'grp', title: 'FASActivity', tpHide: true, editable: false, menuInHide: true, minWidth: 150 },
{ dataIndx: "FASActivity", title: "FAS Activity", editable: false, hidden: true, filter: { groupIndx: 'Source' } },
{ title: "TRAN_TYPE", hidden: true, dataIndx: "TRAN_TYPE" },
{ title: "Source", width: 20, dataIndx: "Source" },
{ title: "Account Code", width: 20, dataIndx: "ACCNT_CODE" },
{ title: "Date", align: "right", width: 20, dataIndx: "JCDATE" },
{ title: "Description", width: 200, dataIndx: "FASDesc" },
{
title: "Amount", width: 85, format: '$ #,###,###.00', align: "right", dataIndx: "AMOUNT", summary: { type: "sum" },
render: function (ui) {
if (ui.cellData < 0) {
return {
cls: 'blinkText',
style: { 'color': 'red'}
};
}
}
}
]
groupModel = {
on: true, //grouping mode.
pivot: false, //pivotMode
checkbox: false,
checkboxHead: true,
select: false,
titleIndx: 'grp', //v7.0.0: new option instead of titleInFirstCol
indent: 20,
fixCols: false,
groupCols: ['Source'], //grouping along column axis.
header: false, //hide grouping toolbar.
grandSummary: true, //show grand summary row.
dataIndx: ['FASActivity'], //grouping along row axis.
collapsed: [true],
useLabel: true,
summaryEdit: false
};
$("#Transactiondetails").html(data);
$("#grid_transactions").pqGrid({
height: 450,
scrollModel: { autoFit: true },
dataModel: dataModelTransaction,
colModel: colModelTransaction,
pageModel: { type: "local", rPP: 1000, strRpp: "" },
numberCell: { show: false },
title: "Transaction Details",
resizable: true,
groupModel: groupModel,
summaryTitle: {
sum: ""
},
rowInit: function (ui) {
if (ui.rowData.TRAN_TYPE == "B") {
return {
style: { "background": "yellow" } //can also return attr (for attributes) and cls (for css classes) properties.
};
}
}
});
For example - I have a grid result that has budget (in yellow) and transaction data (in black). I do not want the budget amounts in the Group total calculation (see attached screen shot).
Below is my javascript code:
dataModelTransaction= {
location: "remote",
dataType: "jsonp",
method: "GET",
url: "/CCRSearch/Reports/[email protected]",
}
colModelTransaction = [
{ dataIndx: 'grp', title: 'FASActivity', tpHide: true, editable: false, menuInHide: true, minWidth: 150 },
{ dataIndx: "FASActivity", title: "FAS Activity", editable: false, hidden: true, filter: { groupIndx: 'Source' } },
{ title: "TRAN_TYPE", hidden: true, dataIndx: "TRAN_TYPE" },
{ title: "Source", width: 20, dataIndx: "Source" },
{ title: "Account Code", width: 20, dataIndx: "ACCNT_CODE" },
{ title: "Date", align: "right", width: 20, dataIndx: "JCDATE" },
{ title: "Description", width: 200, dataIndx: "FASDesc" },
{
title: "Amount", width: 85, format: '$ #,###,###.00', align: "right", dataIndx: "AMOUNT", summary: { type: "sum" },
render: function (ui) {
if (ui.cellData < 0) {
return {
cls: 'blinkText',
style: { 'color': 'red'}
};
}
}
}
]
groupModel = {
on: true, //grouping mode.
pivot: false, //pivotMode
checkbox: false,
checkboxHead: true,
select: false,
titleIndx: 'grp', //v7.0.0: new option instead of titleInFirstCol
indent: 20,
fixCols: false,
groupCols: ['Source'], //grouping along column axis.
header: false, //hide grouping toolbar.
grandSummary: true, //show grand summary row.
dataIndx: ['FASActivity'], //grouping along row axis.
collapsed: [true],
useLabel: true,
summaryEdit: false
};
$("#Transactiondetails").html(data);
$("#grid_transactions").pqGrid({
height: 450,
scrollModel: { autoFit: true },
dataModel: dataModelTransaction,
colModel: colModelTransaction,
pageModel: { type: "local", rPP: 1000, strRpp: "" },
numberCell: { show: false },
title: "Transaction Details",
resizable: true,
groupModel: groupModel,
summaryTitle: {
sum: ""
},
rowInit: function (ui) {
if (ui.rowData.TRAN_TYPE == "B") {
return {
style: { "background": "yellow" } //can also return attr (for attributes) and cls (for css classes) properties.
};
}
}
});