:: Documentation >>

AW.System.Format

Generic base class for the various data format converters.

Format converters are used to change the data appearance between 'datasource' format and the actual display text, for example, when the source XML contains dates in ISO8601 format (like 2004-05-18T00:00:00+01:00) but the end users want to see them as mmm d, yyyy (May 5, 2004).

They are also used for sorting of the grid rows – the format objects convert the cell text to the comparable values and supply comparator function.

Constructor

 var obj = new AW.System.Format; 

Hierarchy

Parent Classes:
AW.System.Object

Methods

cloneCreates an object clone.
comparatorReturns comparator function.
dataToTextTransforms the external data to the readable text.
dataToValueTransforms the external data to the native value type.
initInitializes the object.
setErrorTextSets the error text.
setErrorValueSets the error value.
setTimeoutCalls the function after the specified delay.
textToDataTransforms the text to the external data format.
textToValueTransforms the text to the native value type.
toStringConverts object to string.
valueToDataTransforms the value to the external data format.
valueToTextTransforms the value to the readable text.

Examples

var string = new AW.Formats.String;
var number = new AW.Formats.Number;
var date = new AW.Formats.Date;

number.setTextFormat("$ #,###.##");
date.setDataFormat("ISO8601"); 
date.setTextFormat("mm/dd/yy");

grid.setCellFormat([string, number, number, date]);

See also

Overview: formats/conversions
Formatting classes: number, string, html, date,
Grid cell properties: text, value, data, format

Comments

Sort separation of numbers and strings in a column Anthony (4)
[no subject] Elia (0)

Documentation:

Recent changes:

2.6.4
2.6.3
2.6.2
2.6.1
2.6.1
2.6.0
2.5.0 - 2.5.6
2.5.6
2.5.0 - 2.5.5
2.5.5