X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..25ef3491bd9ae007ff1fc2b0d7943e6eaaccf775:/src/core/Template-more.js diff --git a/src/core/Template-more.js b/src/core/Template-more.js index d6a5f92d..ef37a257 100644 --- a/src/core/Template-more.js +++ b/src/core/Template-more.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.0.0 + * Ext JS Library 3.0.3 * Copyright(c) 2006-2009 Ext JS, LLC * licensing@extjs.com * http://www.extjs.com/license @@ -8,6 +8,39 @@ * @class Ext.Template */ Ext.apply(Ext.Template.prototype, { + /** + * @cfg {Boolean} disableFormats Specify true to disable format + * functions in the template. If the template does not contain + * {@link Ext.util.Format format functions}, setting disableFormats + * to true will reduce {@link #apply} time. Defaults to false. + *

+var t = new Ext.Template(
+    '<div name="{id}">',
+        '<span class="{cls}">{name} {value}</span>',
+    '</div>',
+    {
+        compiled: true,      // {@link #compile} immediately
+        disableFormats: true // reduce {@link #apply} time since no formatting
+    }    
+);
+     * 
+ * For a list of available format functions, see {@link Ext.util.Format}. + */ + disableFormats : false, + /** + * See {@link #disableFormats}. + * @type Boolean + * @property disableFormats + */ + + /** + * The regular expression used to match template variables + * @type RegExp + * @property + * @hide repeat doc + */ + re : /\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g, + /** * Returns an HTML fragment of this template with the specified values applied. * @param {Object/Array} values The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'}) @@ -50,21 +83,6 @@ Ext.apply(Ext.Template.prototype, { return me.html.replace(me.re, fn); }, - /** - * true to disable format functions (defaults to false) - * @type Boolean - * @property - */ - disableFormats : false, - - /** - * The regular expression used to match template variables - * @type RegExp - * @property - * @hide repeat doc - */ - re : /\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g, - /** * Compiles the template into an internal function, eliminating the RegEx overhead. * @return {Ext.Template} this