:: Forum >>

JS setCellFormat() does not work in 2.0b3

It appears that none of the formats (number, date, ...) work for JS arrays in AW version 2.0b3
Rick Villela
Monday, December 12, 2005
I can confirm this. No matter what i do formats do not seem to work for JS arrays.
Joe
Tuesday, January 3, 2006
Yes, I conccur...

How is this supposed to work?
Peg
Monday, January 30, 2006
Is this still an issue with Beta 4? I was under the impression that Beta 4 fixed a lot of the format issues. What specific issues are you having now with Beta 4?
Jim Hunter
Monday, January 30, 2006
Cell formatting works if you assign your data using setCellData() method and want it to be converted to cell text -

var myData = [
        ["text", "123", "12-1-2005"],
        ["more text", "56.1", "3-21-2004"]
    ]

    var str = new AW.Formats.String;
    var num = new AW.Formats.Number;
    var date = new AW.Formats.Date;

    num.setTextFormat("###.##");
    date.setTextFormat("d-mmm-yyyy");

    var obj = new AW.UI.Grid;

    obj.setCellData(myData);
    obj.setCellFormat([str, num, date])

    obj.setColumnCount(3);
    obj.setRowCount(2);

    document.write(obj);


If you assing the array directly to the cell text using setCellText() method - then formatting will not work because the cell text is exactly what you see. In this case formatting objects are only used during sorting to provide reverse transformation (textToValue).
Alex (ActiveWidgets)
Monday, January 30, 2006

This topic is archived.


Back to support forum

Forum search