Hi Isomorphic,
I noticed this bug in my Application in SmartGWT 5.1p and 6.1p. I managed to reproduce in SmartClient 10.1p (v10.1p_2017-04-15) and 11.1d (SNAPSHOT_v11.1d_2017-04-16) in GC57 and FF26. Please see this showcase sample and modify it as follows:
I modified the groupByField (two fields now), canMultiGroup:true and added a getGroupTitle for the category-field.
If you start the sample, open the MultiGroupDialog and change the order of the two groupBy-fields, you'll get this unexpected result:

Some points to notice:
Blama
I noticed this bug in my Application in SmartGWT 5.1p and 6.1p. I managed to reproduce in SmartClient 10.1p (v10.1p_2017-04-15) and 11.1d (SNAPSHOT_v11.1d_2017-04-16) in GC57 and FF26. Please see this showcase sample and modify it as follows:
Code:
isc.ListGrid.create({
ID: "companyList",
width:600, height:520,
alternateRecordStyles:true,
autoFetchData:true,
dataSource:orderItemLocalDS,
showAllRecords:true,
canMultiGroup:true,
groupByField:["category", "shipDate"],
groupStartOpen:"all",
canEdit:true, editEvent:"click",
showGridSummary:true,
showGroupSummary:true,
fields:[
{name:"orderID", includeInRecordSummary:false, summaryFunction:"count"},
{name:"itemDescription"},
{name:"category", showGridSummary:true,
getGridSummary:function (records, summaryField) {
var seenCategories = {};
for (var i = 0; i < records.length; i++) {
seenCategories[records[i].category] = true;
}
var totalCategories = isc.getKeys(seenCategories).length;
return totalCategories + " Categories";
},
getGroupTitle : function (groupValue, groupNode, field, fieldName, grid) {
return "groupValue: " + groupValue;
}
},
{name:"shipDate", showGroupSummary:true, showGridSummary:false, summaryFunction:"max", groupingMode:"monthAndYear"},
{name:"quantity", showGroupSummary:false, showGridSummary:false},
{name:"unitPrice", showGroupSummary:false, showGridSummary:false,
formatCellValue:function (value) {
if (isc.isA.Number(value)) {
return value.toCurrencyString("$");
}
return value;
}
},
{name:"Total", type:"summary", recordSummaryFunction:"multiplier",
summaryFunction:"sum",
showGridSummary:true, showGroupSummary:true,
align:"right",
formatCellValue:function (value) {
if (isc.isA.Number(value)) {
return value.toCurrencyString("$");
}
return value;
}
}
]
})
If you start the sample, open the MultiGroupDialog and change the order of the two groupBy-fields, you'll get this unexpected result:
Some points to notice:
- This does not happen if you start with groupByField:["shipDate", "category"] (then you'd have to change the order twice to provoke the issue).
- This does not happen if you remove the getGroupTitle-function or just do return groupValue;
- This does not happen if you just group by category.
- -> It seems to be "2nd level grouping with a getGroupTitle defined"-related.
Blama
Comment