Module Ext_util_Format


module Ext_util_Format: sig .. end
This class is a centralized place for formatting f ...

This class is a centralized place for formatting functions. It includes functions to format various different types of data, such as text, dates and numeric values.

Localization

This class contains several options for localization. These can be set once the library has loaded, all calls to the functions from that point will use the locale settings that were specified.

Options include:

This class also uses the default date format defined here: Ext.Date.defaultFormat.

Using with renderers

There are two helper functions that return a new function that can be used in conjunction with grid renderers:

columns: [{
    dataIndex: 'date',
    renderer: Ext.util.Format.dateRenderer('Y-m-d')
}, {
    dataIndex: 'time',
    renderer: Ext.util.Format.numberRenderer('0.000')
}]

Functions that only take a single argument can also be passed directly:

columns: [{
    dataIndex: 'cost',
    renderer: Ext.util.Format.usMoney
}, {
    dataIndex: 'productCode',
    renderer: Ext.util.Format.uppercase
}]

Using with XTemplates

XTemplates can also directly use Ext.util.Format functions:

new Ext.XTemplate([
    'Date: {startDate:date("Y-m-d")}',
    'Cost: {cost:usMoney}'
]);


class type t = object .. end
class type configs = object .. end
class type events = object .. end
class type statics = object .. end
val get_instance : unit -> t Js.t
Singleton instance for lazy-loaded modules.
val instance : t Js.t
Singleton instance.
val of_configs : configs Js.t -> t Js.t
of_configs c casts a config object c to an instance of class t
val to_configs : t Js.t -> configs Js.t
to_configs o casts instance o of class t to a config object