Home >Web Front-end >JS Tutorial >Commonly used Extjs tools: How to use Extjs.util.Format_extjs
Copy some common tools for easy search
----------String
Ext.util.Format.capitalize(string str);//Change the first letter to uppercase
Ext.util. Format.ellipsis(string value, Number length); //Intercept the specified length characters, and an ellipsis '...' will be added at the end automatically
Ext.util.Format.htmlEncode(string value); //Encode the text
lowercase(string value);//Change to lower case
stripScripts(Mixed value);//Delete all Script tags
stripTags(Mixed value);//Delete all tags
substr(value, start, length)
trim(value)
----------Date
Ext.util.Format.date(Mixd value, [String format]); Such as: Ext.util.Format.date(new Date(), 'Y-m-d')=>2012-03-19
Ext.util.Format.dateRenderer(string format);//Exclusively for Ext.grid. Used by Gridpanel,
---------dormitory judgment in ColumnModel
defaultValue(Mixed value, string defalutValue);//If the first parameter is empty, return the second one, on the contrary.
undef(Mixed value;//If value is equal to empty, return an empty string, otherwise return value
==========Extended Function
1. createCallback() A callback function for the current function will be created, such as: