:: Forum >> Version 2 >>

setCellFormat

More information on this topic is available in the documentation section: /aw.ui.grid/cell-format.html.

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
Wednesday, March 15, 2006
Steve,

here is an example -

<style>
    .
aw-column-{
        
text-alignright;
    }
</
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(ccy1);

    
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)
Thursday, March 16, 2006



This topic is archived.

Back to /aw.ui.grid/cell-format.html

Documentation:

Forum search