3.2.0

Currency format not working in 2.0.2 for JS Array

If I do the following:

// define data formats
var str = new AW.Formats.String;
var num = new AW.Formats.Number;

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

obj.setCellFormat([str, str, num, cur, num]);

in the example code for the XML dataset it works as expected but if you use the same code with the JS array it does not...
Mark Elrod
July 12,
Depends on where you put the array, this one works as expected -
var myData = [[12345]];

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

var obj = new AW.UI.Grid;
obj.setCellData(myData);
obj.setCellFormat([cur]);
obj.setColumnCount(1);
obj.setRowCount(1);

document.write(obj);


But it will not be doing any formatting if you put the data directly into the cellText property, like

obj.setCellText(myData);
Alex (ActiveWidgets)
July 12,
Figured out my issue. My clearGrid code was being called accidentally which did this:

function clearGrid(obj){
obj.clearCellModel();
obj.clearRowModel();
obj.clearScrollModel();
obj.clearSelectionModel();
obj.clearSortModel();
obj.refresh();
}
Mark Elrod
July 12,

This topic is archived.

See also:


Back to support forum