PDA

View Full Version : [CLOSED] Problem whit SummaryRenderer



ronbreizh
29 Apr 2009, 4:48 AM
Hello,

I have a problem with a SummaryRenderer when i reorder the lines of a GroupingStore and i think it's a bug.

I have this code :



columnConfig = new SummaryColumnConfig();
columnConfig.setId("montant");
columnConfig.setHeader("<b>Montant</b>");
columnConfig.setWidth(90);
columnConfig.setAlignment(HorizontalAlignment.RIGHT);
columnConfig.setNumberFormat(NumberFormat.getFormat("#,###.00#"));
columnConfig.setRenderer(new GridCellRenderer() {
public String render(ModelData model, String property, ColumnData config, int rowIndex, int colIndex, ListStore store) {
return model.get(property) + " &euro;";
}
});
columnConfig.setSummaryType(SummaryType.SUM);
columnConfig.setSummaryRenderer(new SummaryRenderer() {
public String render(Double value, Map<String, Double> data) {

return value.doubleValue() + " &euro;";

}
});
columnConfig.setGroupable(false);
columns.add(columnConfig);


the result is : the image Exemple 1.jpg

you can note that the total is not well formated.

Now if I have this code, it's nice but I would kno why and i think there is a problem.



columnConfig = new SummaryColumnConfig();
columnConfig.setId("montant");
columnConfig.setHeader("<b>Montant</b>");
columnConfig.setWidth(90);
columnConfig.setAlignment(HorizontalAlignment.RIGHT);
columnConfig.setNumberFormat(NumberFormat.getFormat("#,###.00#"));
columnConfig.setRenderer(new GridCellRenderer() {
public String render(ModelData model, String property, ColumnData config, int rowIndex, int colIndex, ListStore store) {
return model.get(property) + " &euro;";
}
});
columnConfig.setSummaryType(SummaryType.SUM);
columnConfig.setSummaryRenderer(new SummaryRenderer() {
public String render(Double value, Map<String, Double> data) {

return value.floatValue() + " &euro;";

}
});
columnConfig.setGroupable(false);
columns.add(columnConfig);


the result is : the image Exemple 2.jpg

Have you got an idea? Is it a bug?

Thanks a lot !!!

NB : Sorry for the English

sven
29 Apr 2009, 5:20 AM
It is as you told it to be. No bug.

ronbreizh
29 Apr 2009, 5:38 AM
It is as you told it to be. No bug.

Can you explain please?
why having xxxxx,180000000000... only on any configurations so?