Working with the SummaryRowLayer and TreeLayer [message #1243311] |
Mon, 10 February 2014 20:40 |
Evan O\'Connell Messages: 14 Registered: August 2013 |
Junior Member |
|
|
Hello,
I modified the _572_TreeGridExample to include the SummaryRowLayer. It seems that the SummaryRow will only calculate the sum of the cells whos row group is expanded. Is this intentional?
Looking at the SummationSummaryProvider:
public Object summarize(int columnIndex) {
int rowCount = dataProvider.getRowCount();
float summaryValue = 0;
for (int rowIndex = 0; rowIndex < rowCount; rowIndex++) {
Object dataValue = dataProvider.getDataValue(columnIndex, rowIndex);
if (dataValue instanceof Number) {
summaryValue = summaryValue + Float.parseFloat(dataValue.toString());
} else if (strict) {
return DEFAULT_SUMMARY_VALUE;
}
}
return summaryValue;
}
When the tree is fully expanded the DataProvider returns 10 rows and the method calculates the sum for the entire column. However, when the a row group is collapsed, the DataProvider returns 9 rows and the method does not calculate the sum using the collapsed row. This is true for both the GlazedListDataProvider and the ListDataProvider.
I would like to be able to code the SummaryProvider so that it will calculate the sum using the underlying data regardless of whether the data in that row is hidden by the tree.
Is this possible with one of the existing DataProviders? or possibly some other class?
Thanks,
Evan
[Updated on: Mon, 10 February 2014 20:41] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02242 seconds