3.2.0

setCellFormat

Any chance of an example on this? I'm trying to set all the cells in a particular column to right align & to be formatted as a currency string.

Cheers.
Steve Childs
March 15,
Steve,

here is an example -

<style>
    .aw-column-1 {
        text-align: right;
    }
</style>
<script>
    var obj = new AW.UI.Grid;
    obj.setCellData("123456", 1);
    obj.setColumnCount(10);
    obj.setRowCount(10);

    var ccy = new AW.Formats.Number;
    ccy.setTextFormat("$ #,###.##");
    obj.setCellFormat(ccy, 1);

    document.write(obj);
</script>


You can use CSS rules attached to .aw-column-... selector to style your cell text (color or alignment).

If you want to transform the cell data on the client - assing it to cell data property (instead of cell text) and use AW.Formats.... classes.
Alex (ActiveWidgets)
March 16,

This topic is archived.

See also:


Back to support forum