- sep = Ext.isGecko ? "+" : ",";
-
- function fn(m, name){
- name = "values['" + name + "']";
- return "'"+ sep + '(' + name + " == undefined ? '' : " + name + ')' + sep + "'";
- }
-
- eval("this.compiled = function(values){ return " + (Ext.isGecko ? "'" : "['") +
- me.html.replace(/\\/g, '\\\\').replace(/(\r\n|\n)/g, '\\n').replace(/'/g, "\\'").replace(this.re, fn) +
- (Ext.isGecko ? "';};" : "'].join('');};"));
- return me;
- },
-
- <div id="method-Ext.Template-insertFirst"></div>/**
- * Applies the supplied values to the template and inserts the new node(s) as the first child of el.
- * @param {Mixed} el The context element
- * @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'})
- * @param {Boolean} returnElement (optional) true to return a Ext.Element (defaults to undefined)
- * @return {HTMLElement/Ext.Element} The new node or Element
- */
- insertFirst: function(el, values, returnElement){
- return this.doInsert('afterBegin', el, values, returnElement);
- },
-
- <div id="method-Ext.Template-insertBefore"></div>/**
- * Applies the supplied values to the template and inserts the new node(s) before el.
- * @param {Mixed} el The context element
- * @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'})
- * @param {Boolean} returnElement (optional) true to return a Ext.Element (defaults to undefined)
- * @return {HTMLElement/Ext.Element} The new node or Element
- */
- insertBefore: function(el, values, returnElement){
- return this.doInsert('beforeBegin', el, values, returnElement);
- },
-
- <div id="method-Ext.Template-insertAfter"></div>/**
- * Applies the supplied values to the template and inserts the new node(s) after el.
- * @param {Mixed} el The context element
- * @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'})
- * @param {Boolean} returnElement (optional) true to return a Ext.Element (defaults to undefined)
- * @return {HTMLElement/Ext.Element} The new node or Element
- */
- insertAfter : function(el, values, returnElement){
- return this.doInsert('afterEnd', el, values, returnElement);
- },
-
- <div id="method-Ext.Template-append"></div>/**
- * Applies the supplied values to the template and appends the new node(s) to el.
- * @param {Mixed} el The context element
- * @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'})
- * @param {Boolean} returnElement (optional) true to return a Ext.Element (defaults to undefined)
- * @return {HTMLElement/Ext.Element} The new node or Element
- */
- append : function(el, values, returnElement){
- return this.doInsert('beforeEnd', el, values, returnElement);
- },
-
- doInsert : function(where, el, values, returnEl){
- el = Ext.getDom(el);
- var newNode = Ext.DomHelper.insertHtml(where, el, this.applyTemplate(values));
- return returnEl ? Ext.get(newNode, true) : newNode;
- },