3.0.4

Formats applied to empty cells ANYWAY?

Hi,

i've set a currency format
var money = new AW.Formats.Number;
money.setTextFormat(\"#.###,##\");


and applied it to a specific column (say, column #2)

obj.setCellFormat(money, 2);


Now, if any of the cells from column 2 is empty, or filled with blanks, the format is applied anyway, resulting in the cell showing "0,00" instead of null as I'd like.

What am I doing wrong?

Thanks, ciao

Diabolik
Diabolik
February 28,
Ignore the backslashes (coming from the fact that I'm generating this code with PHP):

var money = new AW.Formats.Number; 
money.setTextFormat("#.###,##"); 
obj.setCellFormat(money, 2);
Diabolik
March 1,
Anybody with a solution yet?
Heeeelp!!

Diabolik
Diabolik
March 3,
I guess I should add special case for null or empty values but for now you can just modify formatting method -

var money = new AW.Formats.Number; 
money.setTextFormat("#.###,##"); 

money.dataToText1 = money.dataToText;
money.dataToText = function(data){
    return data ? this.dataToText1(data) : "";
}

obj.setCellFormat(money, 2);
Alex (ActiveWidgets)
March 3,
Thanks Alex, it works perfectly!
Ciao,

Diabolik
Diabolik
March 5,
I have the same problem with Date format but the grid displays #ERR whent the cell is empty.

Alex I tried your work around but it gives me a Stack overflow error
on large data sets 1000+ (not really that large)

Colin P
March 10,

This topic is archived.

See also:


Back to support forum

Search

Version 2

Looking for AW 2.6 ?
The old site is here.