X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/3789b528d8dd8aad4558e38e22d775bcab1cbd36..f562e4c6e5fac7bcb445985b99acbea4d706e6f0:/docs/output/Ext.util.Format.js diff --git a/docs/output/Ext.util.Format.js b/docs/output/Ext.util.Format.js index eaae0f8b..cc582f8b 100644 --- a/docs/output/Ext.util.Format.js +++ b/docs/output/Ext.util.Format.js @@ -1,820 +1 @@ -Ext.data.JsonP.Ext_util_Format({ - "tagname": "class", - "name": "Ext.util.Format", - "doc": "

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

\n\n

Localization\nThis class contains several options for localization. These can be set once the library has loaded,\nall calls to the functions from that point will use the locale settings that were specified.\nOptions include:\n- thousandSeparator\n- decimalSeparator\n- currenyPrecision\n- currencySign\n- currencyAtEnd\nThis class also uses the default date format defined here: Ext.date.defaultFormat.

\n\n

Using with renderers\nThere are two helper functions that return a new function that can be used in conjunction with\ngrid renderers:

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

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

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

Using with XTemplates\nXTemplates can also directly use Ext.util.Format functions:

\n\n
new Ext.XTemplate([\n    'Date: {startDate:date(\"Y-m-d\")}',\n    'Cost: {cost:usMoney}'\n]);\n
\n", - "extends": null, - "mixins": [ - - ], - "alternateClassNames": [ - - ], - "xtype": null, - "author": null, - "docauthor": null, - "singleton": true, - "private": false, - "cfg": [ - - ], - "method": [ - { - "tagname": "method", - "name": "capitalize", - "member": "Ext.util.Format", - "doc": "

Capitalize the given string. See Ext.String.capitalize.

\n", - "params": [ - - ], - "return": { - "type": "void", - "doc": "\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/util/Format.js", - "linenr": 434, - "html_filename": "Format.html", - "href": "Format.html#Ext-util-Format-method-capitalize", - "shortDoc": "

Capitalize the given string. See Ext.String.capitalize.

\n" - }, - { - "tagname": "method", - "name": "currency", - "member": "Ext.util.Format", - "doc": "

Format a number as a currency

\n", - "params": [ - { - "type": "Number/String", - "name": "value", - "doc": "

The numeric value to format

\n", - "optional": false - }, - { - "type": "String", - "name": "sign", - "doc": "

The currency sign to use (defaults to currencySign)

\n", - "optional": false - }, - { - "type": "Number", - "name": "decimals", - "doc": "

The number of decimals to use for the currency (defaults to currencyPrecision)

\n", - "optional": false - }, - { - "type": "Boolean", - "name": "end", - "doc": "

True if the currency sign should be at the end of the string (defaults to currencyAtEnd)

\n", - "optional": false - } - ], - "return": { - "type": "String", - "doc": "

The formatted currency string

\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/util/Format.js", - "linenr": 165, - "html_filename": "Format.html", - "href": "Format.html#Ext-util-Format-method-currency", - "shortDoc": "

Format a number as a currency

\n" - }, - { - "tagname": "method", - "name": "date", - "member": "Ext.util.Format", - "doc": "

Formats the passed date using the specified format pattern.

\n", - "params": [ - { - "type": "String/Date", - "name": "value", - "doc": "

The value to format. If a string is passed, it is converted to a Date by the Javascript\nDate object's parse() method.

\n", - "optional": false - }, - { - "type": "String", - "name": "format", - "doc": "

(Optional) Any valid date format string. Defaults to Ext.Date.defaultFormat.

\n", - "optional": false - } - ], - "return": { - "type": "String", - "doc": "

The formatted date string.

\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/util/Format.js", - "linenr": 195, - "html_filename": "Format.html", - "href": "Format.html#Ext-util-Format-method-date", - "shortDoc": "

Formats the passed date using the specified format pattern.

\n" - }, - { - "tagname": "method", - "name": "dateRenderer", - "member": "Ext.util.Format", - "doc": "

Returns a date rendering function that can be reused to apply a date format multiple times efficiently

\n", - "params": [ - { - "type": "String", - "name": "format", - "doc": "

Any valid date format string. Defaults to Ext.Date.defaultFormat.

\n", - "optional": false - } - ], - "return": { - "type": "Function", - "doc": "

The date formatting function

\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/util/Format.js", - "linenr": 212, - "html_filename": "Format.html", - "href": "Format.html#Ext-util-Format-method-dateRenderer", - "shortDoc": "

Returns a date rendering function that can be reused to apply a date format multiple times efficiently

\n" - }, - { - "tagname": "method", - "name": "defaultValue", - "member": "Ext.util.Format", - "doc": "

Checks a reference and converts it to the default value if it's empty

\n", - "params": [ - { - "type": "Mixed", - "name": "value", - "doc": "

Reference to check

\n", - "optional": false - }, - { - "type": "String", - "name": "defaultValue", - "doc": "

The value to insert of it's undefined (defaults to \"\")

\n", - "optional": false - } - ], - "return": { - "type": "String", - "doc": "\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/util/Format.js", - "linenr": 117, - "html_filename": "Format.html", - "href": "Format.html#Ext-util-Format-method-defaultValue", - "shortDoc": "

Checks a reference and converts it to the default value if it's empty

\n" - }, - { - "tagname": "method", - "name": "ellipsis", - "member": "Ext.util.Format", - "doc": "

Truncate a string and add an ellipsis ('...') to the end if it exceeds the specified length.\nSee Ext.String.ellipsis.

\n", - "params": [ - - ], - "return": { - "type": "void", - "doc": "\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/util/Format.js", - "linenr": 440, - "html_filename": "Format.html", - "href": "Format.html#Ext-util-Format-method-ellipsis", - "shortDoc": "

Truncate a string and add an ellipsis ('...') to the end if it exceeds the specified length.\nSee Ext.String.ellipsis.

\n" - }, - { - "tagname": "method", - "name": "escapeRegex", - "member": "Ext.util.Format", - "doc": "

Escapes the passed string for use in a regular expression

\n", - "params": [ - { - "type": "String", - "name": "str", - "doc": "\n", - "optional": false - } - ], - "return": { - "type": "String", - "doc": "\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/util/Format.js", - "linenr": 511, - "html_filename": "Format.html", - "href": "Format.html#Ext-util-Format-method-escapeRegex", - "shortDoc": "

Escapes the passed string for use in a regular expression

\n" - }, - { - "tagname": "method", - "name": "fileSize", - "member": "Ext.util.Format", - "doc": "

Simple format for a file size (xxx bytes, xxx KB, xxx MB)

\n", - "params": [ - { - "type": "Number/String", - "name": "size", - "doc": "

The numeric value to format

\n", - "optional": false - } - ], - "return": { - "type": "String", - "doc": "

The formatted file size

\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/util/Format.js", - "linenr": 241, - "html_filename": "Format.html", - "href": "Format.html#Ext-util-Format-method-fileSize", - "shortDoc": "

Simple format for a file size (xxx bytes, xxx KB, xxx MB)

\n" - }, - { - "tagname": "method", - "name": "format", - "member": "Ext.util.Format", - "doc": "

Formats to a string. See Ext.String.format

\n", - "params": [ - - ], - "return": { - "type": "void", - "doc": "\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/util/Format.js", - "linenr": 447, - "html_filename": "Format.html", - "href": "Format.html#Ext-util-Format-method-format", - "shortDoc": "

Formats to a string. See Ext.String.format

\n" - }, - { - "tagname": "method", - "name": "htmlDecode", - "member": "Ext.util.Format", - "doc": "

Convert certain characters (&, <, >, and ') from their HTML character equivalents.\nSee Ext.string.htmlDecode.

\n", - "params": [ - - ], - "return": { - "type": "void", - "doc": "\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/util/Format.js", - "linenr": 453, - "html_filename": "Format.html", - "href": "Format.html#Ext-util-Format-method-htmlDecode", - "shortDoc": "

Convert certain characters (&, <, >, and ') from their HTML character equivalents.\nSee Ext.string.htmlDecode.

\n" - }, - { - "tagname": "method", - "name": "htmlEncode", - "member": "Ext.util.Format", - "doc": "

Convert certain characters (&, <, >, and ') to their HTML character equivalents for literal display in web pages.\nSee Ext.String.htmlEncode.

\n", - "params": [ - - ], - "return": { - "type": "void", - "doc": "\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/util/Format.js", - "linenr": 460, - "html_filename": "Format.html", - "href": "Format.html#Ext-util-Format-method-htmlEncode", - "shortDoc": "Convert certain characters (&, <, >, and ') to their HTML character equivalents for literal display in web pag..." - }, - { - "tagname": "method", - "name": "leftPad", - "member": "Ext.util.Format", - "doc": "

Adds left padding to a string. See Ext.String.leftPad

\n", - "params": [ - - ], - "return": { - "type": "void", - "doc": "\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/util/Format.js", - "linenr": 467, - "html_filename": "Format.html", - "href": "Format.html#Ext-util-Format-method-leftPad", - "shortDoc": "

Adds left padding to a string. See Ext.String.leftPad

\n" - }, - { - "tagname": "method", - "name": "lowercase", - "member": "Ext.util.Format", - "doc": "

Converts a string to all lower case letters

\n", - "params": [ - { - "type": "String", - "name": "value", - "doc": "

The text to convert

\n", - "optional": false - } - ], - "return": { - "type": "String", - "doc": "

The converted text

\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/util/Format.js", - "linenr": 138, - "html_filename": "Format.html", - "href": "Format.html#Ext-util-Format-method-lowercase", - "shortDoc": "

Converts a string to all lower case letters

\n" - }, - { - "tagname": "method", - "name": "math", - "member": "Ext.util.Format", - "doc": "

It does simple math for use in a template, for example:

\n\n
var tpl = new Ext.Template('{value} * 10 = {value:math(\"* 10\")}');\n
\n\n", - "params": [ - - ], - "return": { - "type": "Function", - "doc": "

A function that operates on the passed value.

\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/util/Format.js", - "linenr": 256, - "html_filename": "Format.html", - "href": "Format.html#Ext-util-Format-method-math", - "shortDoc": "It does simple math for use in a template, for example:\n\nvar tpl = new Ext.Template('{value} * 10 = {value:math(\"* 10..." - }, - { - "tagname": "method", - "name": "nl2br", - "member": "Ext.util.Format", - "doc": "

Converts newline characters to the HTML tag <br/>

\n", - "params": [ - { - "type": "String", - "name": "The", - "doc": "

string value to format.

\n", - "optional": false - } - ], - "return": { - "type": "String", - "doc": "

The string with embedded <br/> tags in place of newlines.

\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/util/Format.js", - "linenr": 425, - "html_filename": "Format.html", - "href": "Format.html#Ext-util-Format-method-nl2br", - "shortDoc": "

Converts newline characters to the HTML tag <br/>

\n" - }, - { - "tagname": "method", - "name": "number", - "member": "Ext.util.Format", - "doc": "

Formats the passed number according to the passed format string.

\n\n\n

The number of digits after the decimal separator character specifies the number of\ndecimal places in the resulting string. The local-specific decimal character is used in the result.

\n\n\n

The presence of a thousand separator character in the format string specifies that\nthe locale-specific thousand separator (if any) is inserted separating thousand groups.

\n\n\n

By default, \",\" is expected as the thousand separator, and \".\" is expected as the decimal separator.

\n\n\n

New to Ext4

\n\n\n

Locale-specific characters are always used in the formatted output when inserting\nthousand and decimal separators.

\n\n\n

The format string must specify separator characters according to US/UK conventions (\",\" as the\nthousand separator, and \".\" as the decimal separator)

\n\n\n

To allow specification of format strings according to local conventions for separator characters, add\nthe string /i to the end of the format string.

\n\n\n
examples (123456.789):\n
\n0 - (123456) show only digits, no precision
\n0.00 - (123456.78) show only digits, 2 precision
\n0.0000 - (123456.7890) show only digits, 4 precision
\n0,000 - (123,456) show comma and digits, no precision
\n0,000.00 - (123,456.78) show comma and digits, 2 precision
\n0,0.00 - (123,456.78) shortcut method, show comma and digits, 2 precision
\nTo allow specification of the formatting string using UK/US grouping characters (,) and decimal (.) for international numbers, add /i to the end.\nFor example: 0.000,00/i\n
\n\n", - "params": [ - { - "type": "Number", - "name": "v", - "doc": "

The number to format.

\n", - "optional": false - }, - { - "type": "String", - "name": "format", - "doc": "

The way you would like to format this text.

\n", - "optional": false - } - ], - "return": { - "type": "String", - "doc": "

The formatted number.

\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/util/Format.js", - "linenr": 289, - "html_filename": "Format.html", - "href": "Format.html#Ext-util-Format-method-number", - "shortDoc": "Formats the passed number according to the passed format string.\n\n\nThe number of digits after the decimal separator c..." - }, - { - "tagname": "method", - "name": "numberRenderer", - "member": "Ext.util.Format", - "doc": "

Returns a number rendering function that can be reused to apply a number format multiple times efficiently

\n", - "params": [ - { - "type": "String", - "name": "format", - "doc": "

Any valid number format string for number

\n", - "optional": false - } - ], - "return": { - "type": "Function", - "doc": "

The number formatting function

\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/util/Format.js", - "linenr": 402, - "html_filename": "Format.html", - "href": "Format.html#Ext-util-Format-method-numberRenderer", - "shortDoc": "

Returns a number rendering function that can be reused to apply a number format multiple times efficiently

\n" - }, - { - "tagname": "method", - "name": "parseBox", - "member": "Ext.util.Format", - "doc": "

Parses a number or string representing margin sizes into an object. Supports CSS-style margin declarations\n(e.g. 10, \"10\", \"10 10\", \"10 10 10\" and \"10 10 10 10\" are all valid options and would return the same result)

\n", - "params": [ - { - "type": "Number|String", - "name": "v", - "doc": "

The encoded margins

\n", - "optional": false - } - ], - "return": { - "type": "Object", - "doc": "

An object with margin sizes for top, right, bottom and left

\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/util/Format.js", - "linenr": 479, - "html_filename": "Format.html", - "href": "Format.html#Ext-util-Format-method-parseBox", - "shortDoc": "Parses a number or string representing margin sizes into an object. Supports CSS-style margin declarations\n(e.g. 10, ..." - }, - { - "tagname": "method", - "name": "plural", - "member": "Ext.util.Format", - "doc": "

Selectively do a plural form of a word based on a numeric value. For example, in a template,\n{commentCount:plural(\"Comment\")} would result in \"1 Comment\" if commentCount was 1 or would be \"x Comments\"\nif the value is 0 or greater than 1.

\n", - "params": [ - { - "type": "Number", - "name": "value", - "doc": "

The value to compare against

\n", - "optional": false - }, - { - "type": "String", - "name": "singular", - "doc": "

The singular form of the word

\n", - "optional": false - }, - { - "type": "String", - "name": "plural", - "doc": "

(optional) The plural form of the word (defaults to the singular with an \"s\")

\n", - "optional": true - } - ], - "return": { - "type": "void", - "doc": "\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/util/Format.js", - "linenr": 413, - "html_filename": "Format.html", - "href": "Format.html#Ext-util-Format-method-plural", - "shortDoc": "Selectively do a plural form of a word based on a numeric value. For example, in a template,\n{commentCount:plural(\"Co..." - }, - { - "tagname": "method", - "name": "round", - "member": "Ext.util.Format", - "doc": "

Rounds the passed number to the required decimal precision.

\n", - "params": [ - { - "type": "Number/String", - "name": "value", - "doc": "

The numeric value to round.

\n", - "optional": false - }, - { - "type": "Number", - "name": "precision", - "doc": "

The number of decimal places to which to round the first parameter's value.

\n", - "optional": false - } - ], - "return": { - "type": "Number", - "doc": "

The rounded value.

\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/util/Format.js", - "linenr": 274, - "html_filename": "Format.html", - "href": "Format.html#Ext-util-Format-method-round", - "shortDoc": "

Rounds the passed number to the required decimal precision.

\n" - }, - { - "tagname": "method", - "name": "stripScripts", - "member": "Ext.util.Format", - "doc": "

Strips all script tags

\n", - "params": [ - { - "type": "Mixed", - "name": "value", - "doc": "

The text from which to strip script tags

\n", - "optional": false - } - ], - "return": { - "type": "String", - "doc": "

The stripped text

\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/util/Format.js", - "linenr": 232, - "html_filename": "Format.html", - "href": "Format.html#Ext-util-Format-method-stripScripts", - "shortDoc": "

Strips all script tags

\n" - }, - { - "tagname": "method", - "name": "stripTags", - "member": "Ext.util.Format", - "doc": "

Strips all HTML tags

\n", - "params": [ - { - "type": "Mixed", - "name": "value", - "doc": "

The text from which to strip tags

\n", - "optional": false - } - ], - "return": { - "type": "String", - "doc": "

The stripped text

\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/util/Format.js", - "linenr": 223, - "html_filename": "Format.html", - "href": "Format.html#Ext-util-Format-method-stripTags", - "shortDoc": "

Strips all HTML tags

\n" - }, - { - "tagname": "method", - "name": "substr", - "member": "Ext.util.Format", - "doc": "

Returns a substring from within an original string

\n", - "params": [ - { - "type": "String", - "name": "value", - "doc": "

The original text

\n", - "optional": false - }, - { - "type": "Number", - "name": "start", - "doc": "

The start index of the substring

\n", - "optional": false - }, - { - "type": "Number", - "name": "length", - "doc": "

The length of the substring

\n", - "optional": false - } - ], - "return": { - "type": "String", - "doc": "

The substring

\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/util/Format.js", - "linenr": 127, - "html_filename": "Format.html", - "href": "Format.html#Ext-util-Format-method-substr", - "shortDoc": "

Returns a substring from within an original string

\n" - }, - { - "tagname": "method", - "name": "trim", - "member": "Ext.util.Format", - "doc": "

Trims any whitespace from either side of a string. See Ext.String.trim.

\n", - "params": [ - - ], - "return": { - "type": "void", - "doc": "\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/util/Format.js", - "linenr": 473, - "html_filename": "Format.html", - "href": "Format.html#Ext-util-Format-method-trim", - "shortDoc": "

Trims any whitespace from either side of a string. See Ext.String.trim.

\n" - }, - { - "tagname": "method", - "name": "undef", - "member": "Ext.util.Format", - "doc": "

Checks a reference and converts it to empty string if it is undefined

\n", - "params": [ - { - "type": "Mixed", - "name": "value", - "doc": "

Reference to check

\n", - "optional": false - } - ], - "return": { - "type": "Mixed", - "doc": "

Empty string if converted, otherwise the original value

\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/util/Format.js", - "linenr": 108, - "html_filename": "Format.html", - "href": "Format.html#Ext-util-Format-method-undef", - "shortDoc": "

Checks a reference and converts it to empty string if it is undefined

\n" - }, - { - "tagname": "method", - "name": "uppercase", - "member": "Ext.util.Format", - "doc": "

Converts a string to all upper case letters

\n", - "params": [ - { - "type": "String", - "name": "value", - "doc": "

The text to convert

\n", - "optional": false - } - ], - "return": { - "type": "String", - "doc": "

The converted text

\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/util/Format.js", - "linenr": 147, - "html_filename": "Format.html", - "href": "Format.html#Ext-util-Format-method-uppercase", - "shortDoc": "

Converts a string to all upper case letters

\n" - }, - { - "tagname": "method", - "name": "usMoney", - "member": "Ext.util.Format", - "doc": "

Format a number as US currency

\n", - "params": [ - { - "type": "Number/String", - "name": "value", - "doc": "

The numeric value to format

\n", - "optional": false - } - ], - "return": { - "type": "String", - "doc": "

The formatted currency string

\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/util/Format.js", - "linenr": 156, - "html_filename": "Format.html", - "href": "Format.html#Ext-util-Format-method-usMoney", - "shortDoc": "

Format a number as US currency

\n" - } - ], - "property": [ - { - "tagname": "property", - "name": "currencyAtEnd", - "member": "Ext.util.Format", - "type": "Boolean", - "doc": "

This may be set to true to make the currency function\nappend the currency sign to the formatted value.

\n\n\n

This defaults to false, but may be overridden in a locale file.

\n\n", - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/util/Format.js", - "linenr": 99, - "html_filename": "Format.html", - "href": "Format.html#Ext-util-Format-property-currencyAtEnd", - "shortDoc": "This may be set to true to make the currency function\nappend the currency sign to the formatted value.\n\n\nThis default..." - }, - { - "tagname": "property", - "name": "currencyPrecision", - "member": "Ext.util.Format", - "type": "Number", - "doc": "

The number of decimal places that the currency function displays.

\n\n\n

This defaults to 2, but may be overridden in a locale file.

\n\n", - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/util/Format.js", - "linenr": 83, - "html_filename": "Format.html", - "href": "Format.html#Ext-util-Format-property-currencyPrecision", - "shortDoc": "The number of decimal places that the currency function displays.\n\n\nThis defaults to 2, but may be overridden in a lo..." - }, - { - "tagname": "property", - "name": "currencySign", - "member": "Ext.util.Format", - "type": "String", - "doc": "

The currency sign that the currency function displays.

\n\n\n

This defaults to $, but may be overridden in a locale file.

\n\n", - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/util/Format.js", - "linenr": 91, - "html_filename": "Format.html", - "href": "Format.html#Ext-util-Format-property-currencySign" - }, - { - "tagname": "property", - "name": "decimalSeparator", - "member": "Ext.util.Format", - "type": "String", - "doc": "

The character that the number function uses as a decimal point.

\n\n\n

This defaults to ., but may be overridden in a locale file.

\n\n", - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/util/Format.js", - "linenr": 75, - "html_filename": "Format.html", - "href": "Format.html#Ext-util-Format-property-decimalSeparator", - "shortDoc": "The character that the number function uses as a decimal point.\n\n\nThis defaults to ., but may be overridden in a loca..." - }, - { - "tagname": "property", - "name": "thousandSeparator", - "member": "Ext.util.Format", - "type": "String", - "doc": "

The character that the number function uses as a thousand separator.

\n\n\n

This defaults to ,, but may be overridden in a locale file.

\n\n", - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/util/Format.js", - "linenr": 67, - "html_filename": "Format.html", - "href": "Format.html#Ext-util-Format-property-thousandSeparator", - "shortDoc": "The character that the number function uses as a thousand separator.\n\n\nThis defaults to ,, but may be overridden in a..." - } - ], - "event": [ - - ], - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/util/Format.js", - "linenr": 1, - "html_filename": "Format.html", - "href": "Format.html#Ext-util-Format", - "cssVar": [ - - ], - "cssMixin": [ - - ], - "component": false, - "superclasses": [ - - ], - "subclasses": [ - - ], - "mixedInto": [ - - ], - "allMixins": [ - - ] -}); \ No newline at end of file +Ext.data.JsonP.Ext_util_Format({"tagname":"class","html":"

Files

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

\n\n

Localization\nThis class contains several options for localization. These can be set once the library has loaded,\nall calls to the functions from that point will use the locale settings that were specified.\nOptions include:\n- thousandSeparator\n- decimalSeparator\n- currenyPrecision\n- currencySign\n- currencyAtEnd\nThis class also uses the default date format defined here: Ext.Date.defaultFormat.

\n\n

Using with renderers\nThere are two helper functions that return a new function that can be used in conjunction with\ngrid renderers:

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

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

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

Using with XTemplates\nXTemplates can also directly use Ext.util.Format functions:

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

Properties

This may be set to true to make the currency function\nappend the currency sign to the formatted value. ...

This may be set to true to make the currency function\nappend the currency sign to the formatted value.

\n\n\n

This may be overridden in a locale file.

\n\n
The number of decimal places that the currency function displays. ...

The number of decimal places that the currency function displays.

\n\n\n

This may be overridden in a locale file.

\n\n
The currency sign that the currency function displays. ...

The currency sign that the currency function displays.

\n\n\n

This may be overridden in a locale file.

\n\n
The character that the number function uses as a decimal point. ...

The character that the number function uses as a decimal point.

\n\n\n

This may be overridden in a locale file.

\n\n
The character that the number function uses as a thousand separator. ...

The character that the number function uses as a thousand separator.

\n\n\n

This may be overridden in a locale file.

\n\n
Defined By

Methods

Alias for Ext.String.capitalize. ...

Alias for Ext.String.capitalize.

\n\n

Capitalize the given string

\n

Parameters

Returns

Format a number as a currency ...

Format a number as a currency

\n

Parameters

Returns

  • String

    The formatted currency string

    \n
Formats the passed date using the specified format pattern. ...

Formats the passed date using the specified format pattern.

\n

Parameters

  • value : String/Date

    The value to format. If a string is passed, it is converted to a Date by the Javascript\nDate object's parse() method.

    \n
  • format : String (optional)

    Any valid date format string. Defaults to Ext.Date.defaultFormat.

    \n

Returns

  • String

    The formatted date string.

    \n
Returns a date rendering function that can be reused to apply a date format multiple times efficiently ...

Returns a date rendering function that can be reused to apply a date format multiple times efficiently

\n

Parameters

Returns

Checks a reference and converts it to the default value if it's empty ...

Checks a reference and converts it to the default value if it's empty

\n

Parameters

  • value : Object

    Reference to check

    \n
  • defaultValue : String

    The value to insert of it's undefined (defaults to \"\")

    \n

Returns

Alias for Ext.String.ellipsis. ...

Alias for Ext.String.ellipsis.

\n\n

Truncate a string and add an ellipsis ('...') to the end if it exceeds the specified length

\n

Parameters

  • value : String

    The string to truncate

    \n
  • length : Number

    The maximum length to allow before truncating

    \n
  • word : Boolean

    True to try to find a common word break

    \n

Returns

Escapes the passed string for use in a regular expression ...

Escapes the passed string for use in a regular expression

\n

Parameters

Returns

Simple format for a file size (xxx bytes, xxx KB, xxx MB) ...

Simple format for a file size (xxx bytes, xxx KB, xxx MB)

\n

Parameters

Returns

  • String

    The formatted file size

    \n
Alias for Ext.String.format. ...

Alias for Ext.String.format.

\n\n

Allows you to define a tokenized string and pass an arbitrary number of arguments to replace the tokens. Each\ntoken must be unique, and must increment in the format {0}, {1}, etc. Example usage:

\n\n
var cls = 'my-class', text = 'Some text';\nvar s = Ext.String.format('<div class=\"{0}\">{1}</div>', cls, text);\n// s now contains the string: '<div class=\"my-class\">Some text</div>'\n       
\n\n

Parameters

  • string : String

    The tokenized string to be formatted

    \n
  • value1 : String

    The value to replace token {0}

    \n
  • value2 : String

    Etc...

    \n

Returns

Alias for Ext.String.htmlDecode. ...

Alias for Ext.String.htmlDecode.

\n\n

Convert certain characters (&, <, >, and \") from their HTML character equivalents.

\n

Parameters

  • value : String

    The string to decode

    \n

Returns

Alias for Ext.String.htmlEncode. ...

Alias for Ext.String.htmlEncode.

\n\n

Convert certain characters (&, <, >, and \") to their HTML character equivalents for literal display in web pages.

\n

Parameters

  • value : String

    The string to encode

    \n

Returns

Alias for Ext.String.leftPad. ...

Alias for Ext.String.leftPad.

\n\n

Pads the left side of a string with a specified character. This is especially useful\nfor normalizing number and date strings. Example usage:

\n\n
var s = Ext.String.leftPad('123', 5, '0');\n// s now contains the string: '00123'\n       
\n\n

Parameters

  • string : String

    The original string

    \n
  • size : Number

    The total length of the output string

    \n
  • character : String (optional)

    The character with which to pad the original string (defaults to empty string \" \")

    \n

Returns

Converts a string to all lower case letters ...

Converts a string to all lower case letters

\n

Parameters

  • value : String

    The text to convert

    \n

Returns

It does simple math for use in a template, for example:\n\nvar tpl = new Ext.Template('{value} * 10 = {value:math(\"* 10...

It does simple math for use in a template, for example:

\n\n
var tpl = new Ext.Template('{value} * 10 = {value:math(\"* 10\")}');\n
\n\n

Returns

  • Function

    A function that operates on the passed value.

    \n
Converts newline characters to the HTML tag <br/> ...

Converts newline characters to the HTML tag <br/>

\n

Parameters

  • The : String

    string value to format.

    \n

Returns

  • String

    The string with embedded <br/> tags in place of newlines.

    \n
Formats the passed number according to the passed format string. ...

Formats the passed number according to the passed format string.

\n\n\n

The number of digits after the decimal separator character specifies the number of\ndecimal places in the resulting string. The local-specific decimal character is used in the result.

\n\n\n

The presence of a thousand separator character in the format string specifies that\nthe locale-specific thousand separator (if any) is inserted separating thousand groups.

\n\n\n

By default, \",\" is expected as the thousand separator, and \".\" is expected as the decimal separator.

\n\n\n

New to Ext JS 4

\n\n\n

Locale-specific characters are always used in the formatted output when inserting\nthousand and decimal separators.

\n\n\n

The format string must specify separator characters according to US/UK conventions (\",\" as the\nthousand separator, and \".\" as the decimal separator)

\n\n\n

To allow specification of format strings according to local conventions for separator characters, add\nthe string /i to the end of the format string.

\n\n\n
examples (123456.789):\n
\n0 - (123456) show only digits, no precision
\n0.00 - (123456.78) show only digits, 2 precision
\n0.0000 - (123456.7890) show only digits, 4 precision
\n0,000 - (123,456) show comma and digits, no precision
\n0,000.00 - (123,456.78) show comma and digits, 2 precision
\n0,0.00 - (123,456.78) shortcut method, show comma and digits, 2 precision
\nTo allow specification of the formatting string using UK/US grouping characters (,) and decimal (.) for international numbers, add /i to the end.\nFor example: 0.000,00/i\n
\n\n

Parameters

  • v : Number

    The number to format.

    \n
  • format : String

    The way you would like to format this text.

    \n

Returns

Returns a number rendering function that can be reused to apply a number format multiple times efficiently ...

Returns a number rendering function that can be reused to apply a number format multiple times efficiently

\n

Parameters

Returns

  • Function

    The number formatting function

    \n
Parses a number or string representing margin sizes into an object. ...

Parses a number or string representing margin sizes into an object. Supports CSS-style margin declarations\n(e.g. 10, \"10\", \"10 10\", \"10 10 10\" and \"10 10 10 10\" are all valid options and would return the same result)

\n

Parameters

Returns

  • Object

    An object with margin sizes for top, right, bottom and left

    \n
Selectively do a plural form of a word based on a numeric value. ...

Selectively do a plural form of a word based on a numeric value. For example, in a template,\n{commentCount:plural(\"Comment\")} would result in \"1 Comment\" if commentCount was 1 or would be \"x Comments\"\nif the value is 0 or greater than 1.

\n

Parameters

  • value : Number

    The value to compare against

    \n
  • singular : String

    The singular form of the word

    \n
  • plural : String (optional)

    The plural form of the word (defaults to the singular with an \"s\")

    \n
Rounds the passed number to the required decimal precision. ...

Rounds the passed number to the required decimal precision.

\n

Parameters

  • value : Number/String

    The numeric value to round.

    \n
  • precision : Number

    The number of decimal places to which to round the first parameter's value.

    \n

Returns

Strips all script tags ...

Strips all script tags

\n

Parameters

  • value : Object

    The text from which to strip script tags

    \n

Returns

Strips all HTML tags ...

Strips all HTML tags

\n

Parameters

  • value : Object

    The text from which to strip tags

    \n

Returns

Returns a substring from within an original string ...

Returns a substring from within an original string

\n

Parameters

  • value : String

    The original text

    \n
  • start : Number

    The start index of the substring

    \n
  • length : Number

    The length of the substring

    \n

Returns

Alias for Ext.String.trim. ...

Alias for Ext.String.trim.

\n\n

Trims whitespace from either end of a string, leaving spaces within the string intact. Example:\n@example\nvar s = ' foo bar ';\nalert('-' + s + '-'); //alerts \"- foo bar -\"\nalert('-' + Ext.String.trim(s) + '-'); //alerts \"-foo bar-\"

\n

Parameters

  • string : String

    The string to escape

    \n

Returns

Checks a reference and converts it to empty string if it is undefined ...

Checks a reference and converts it to empty string if it is undefined

\n

Parameters

  • value : Object

    Reference to check

    \n

Returns

  • Object

    Empty string if converted, otherwise the original value

    \n
Converts a string to all upper case letters ...

Converts a string to all upper case letters

\n

Parameters

  • value : String

    The text to convert

    \n

Returns

Format a number as US currency ...

Format a number as US currency

\n

Parameters

Returns

  • String

    The formatted currency string

    \n
","allMixins":[],"meta":{},"requires":[],"deprecated":null,"extends":null,"inheritable":false,"static":false,"superclasses":[],"singleton":true,"code_type":"nop","alias":null,"statics":{"property":[],"css_var":[],"css_mixin":[],"cfg":[],"method":[],"event":[]},"subclasses":[],"uses":[],"protected":false,"mixins":[],"members":{"property":[{"tagname":"property","deprecated":null,"static":false,"owner":"Ext.util.Format","template":null,"required":null,"protected":false,"name":"currencyAtEnd","id":"property-currencyAtEnd"},{"tagname":"property","deprecated":null,"static":false,"owner":"Ext.util.Format","template":null,"required":null,"protected":false,"name":"currencyPrecision","id":"property-currencyPrecision"},{"tagname":"property","deprecated":null,"static":false,"owner":"Ext.util.Format","template":null,"required":null,"protected":false,"name":"currencySign","id":"property-currencySign"},{"tagname":"property","deprecated":null,"static":false,"owner":"Ext.util.Format","template":null,"required":null,"protected":false,"name":"decimalSeparator","id":"property-decimalSeparator"},{"tagname":"property","deprecated":null,"static":false,"owner":"Ext.util.Format","template":null,"required":null,"protected":false,"name":"thousandSeparator","id":"property-thousandSeparator"}],"css_var":[],"css_mixin":[],"cfg":[],"method":[{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.util.Format","template":false,"required":null,"protected":false,"name":"capitalize","id":"method-capitalize"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.util.Format","template":false,"required":null,"protected":false,"name":"currency","id":"method-currency"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.util.Format","template":false,"required":null,"protected":false,"name":"date","id":"method-date"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.util.Format","template":false,"required":null,"protected":false,"name":"dateRenderer","id":"method-dateRenderer"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.util.Format","template":false,"required":null,"protected":false,"name":"defaultValue","id":"method-defaultValue"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.util.Format","template":false,"required":null,"protected":false,"name":"ellipsis","id":"method-ellipsis"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.util.Format","template":false,"required":null,"protected":false,"name":"escapeRegex","id":"method-escapeRegex"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.util.Format","template":false,"required":null,"protected":false,"name":"fileSize","id":"method-fileSize"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.util.Format","template":false,"required":null,"protected":false,"name":"format","id":"method-format"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.util.Format","template":false,"required":null,"protected":false,"name":"htmlDecode","id":"method-htmlDecode"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.util.Format","template":false,"required":null,"protected":false,"name":"htmlEncode","id":"method-htmlEncode"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.util.Format","template":false,"required":null,"protected":false,"name":"leftPad","id":"method-leftPad"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.util.Format","template":false,"required":null,"protected":false,"name":"lowercase","id":"method-lowercase"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.util.Format","template":false,"required":null,"protected":false,"name":"math","id":"method-math"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.util.Format","template":false,"required":null,"protected":false,"name":"nl2br","id":"method-nl2br"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.util.Format","template":false,"required":null,"protected":false,"name":"number","id":"method-number"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.util.Format","template":false,"required":null,"protected":false,"name":"numberRenderer","id":"method-numberRenderer"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.util.Format","template":false,"required":null,"protected":false,"name":"parseBox","id":"method-parseBox"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.util.Format","template":false,"required":null,"protected":false,"name":"plural","id":"method-plural"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.util.Format","template":false,"required":null,"protected":false,"name":"round","id":"method-round"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.util.Format","template":false,"required":null,"protected":false,"name":"stripScripts","id":"method-stripScripts"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.util.Format","template":false,"required":null,"protected":false,"name":"stripTags","id":"method-stripTags"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.util.Format","template":false,"required":null,"protected":false,"name":"substr","id":"method-substr"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.util.Format","template":false,"required":null,"protected":false,"name":"trim","id":"method-trim"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.util.Format","template":false,"required":null,"protected":false,"name":"undef","id":"method-undef"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.util.Format","template":false,"required":null,"protected":false,"name":"uppercase","id":"method-uppercase"},{"tagname":"method","deprecated":null,"static":false,"owner":"Ext.util.Format","template":false,"required":null,"protected":false,"name":"usMoney","id":"method-usMoney"}],"event":[]},"private":false,"component":false,"name":"Ext.util.Format","alternateClassNames":[],"id":"class-Ext.util.Format","mixedInto":[],"xtypes":{},"files":[{"href":"Format.html#Ext-util-Format","filename":"Format.js"}]}); \ No newline at end of file