PDA

View Full Version : AggregationRowConfig with editable grid



simonswb6
2 Jun 2010, 9:04 AM
I am using the buffered grid example and the editable grid together. I have added a AggregationRowConfig to the bottom of the grid to total the dollars which works correctly. However, when i update a row in the grid using the editor, it does not update the AggregationRowConfig [total] at the bottom. Is there a way to force the AggregationRowConfig to update the total when a row is changed?

This is possible in the live grid, however it seems like i either have the choice of using BufferView or GroupSummaryView but not both.

BufferView view = new BufferView();
grid.setView(view);
or
GroupSummaryView summary = new GroupSummaryView();
grid.setView(summary);

simonswb6
4 Jun 2010, 2:41 AM
Appears that you can render the grid value, but if you do not update the ModelData, the value will not be shown in the summary line.

this line fixed the problem:
task.set("PAID_DOLLARS", dPaidAmt);





final SummaryColumnConfig cPdDol = new SummaryColumnConfig("PAID_DOLLARS", "Paid $", 120);
cPdDol.setNumberFormat(NumberFormat
.getFormat("$ #,##0.00;($#,##0.00)"));
cPdDol.setRenderer(new GridCellRenderer<ModelData>()
{
public String render(ModelData model, String property,
ColumnData config, int rowIndex, int colIndex,
ListStore<ModelData> store, Grid<ModelData> grid)
{
ModelData task = (ModelData) model;
Double dRAPU = new Double(task.get("RAPU").toString());
Double dAdjRAPU = new Double(task.get("ADJ_RAPU").toString());
Double dInvUnits = new Double(task.get("UNITS_INVOICED").toString());
Double dDisUnits = new Double(task.get("LABELER_DISPUTED_UNITS").toString());
Double dCorrAmt = new Double(0d);
double dPaidAmt = processPaidAmt(dRAPU, dAdjRAPU, dInvUnits,
dDisUnits, dCorrAmt);
task.set("PAID_DOLLARS", dPaidAmt);
return NumberFormat.getFormat("$ #,##0.00;($#,##0.00)").format(
dPaidAmt);

}
});

columns.add(cPdDol);






I am using the buffered grid example and the editable grid together. I have added a AggregationRowConfig to the bottom of the grid to total the dollars which works correctly. However, when i update a row in the grid using the editor, it does not update the AggregationRowConfig [total] at the bottom. Is there a way to force the AggregationRowConfig to update the total when a row is changed?

This is possible in the live grid, however it seems like i either have the choice of using BufferView or GroupSummaryView but not both.

BufferView view = new BufferView();
grid.setView(view);
or
GroupSummaryView summary = new GroupSummaryView();
grid.setView(summary);

sven
4 Jun 2010, 2:51 AM
Yes sure you need to update the model.