Changeset 10979
- Timestamp:
- 10/19/07 04:24:42 (9 months ago)
- Location:
- dijit/trunk
- Files:
-
- 2 modified
-
Declaration.js (modified) (1 diff)
-
_Templated.js (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dijit/trunk/Declaration.js
r10522 r10979 36 36 } 37 37 propList.widgetsInTemplate = true; 38 propList._skipNodeCache = true; 38 39 propList.templateString = "<"+srcType+" class='"+src.className+"' dojoAttachPoint='"+(src.getAttribute("dojoAttachPoint")||'')+"' dojoAttachEvent='"+(src.getAttribute("dojoAttachEvent")||'')+"' >"+src.innerHTML.replace(/\%7B/g,"{").replace(/\%7D/g,"}")+"</"+srcType+">"; 39 40 // console.debug(propList.templateString); -
dijit/trunk/_Templated.js
r10791 r10979 38 38 containerNode: null, 39 39 40 // skipNodeCache Boolean: 41 // if using a cached widget template node poses issues for a 42 // particular widget class, it can set this property to ensure 43 // that its template is always re-built from a string 44 _skipNodeCache: false, 45 40 46 // method over-ride 41 47 buildRendering: function(){ … … 46 52 // isn't there already. Returns either a DomNode or a string, depending on 47 53 // whether or not the template contains ${foo} replacement parameters. 48 var cached = dijit._Templated.getCachedTemplate(this.templatePath, this.templateString );54 var cached = dijit._Templated.getCachedTemplate(this.templatePath, this.templateString, this._skipNodeCache); 49 55 50 56 var node; … … 56 62 if(key.charAt(0) == '!'){ value = _this[key.substr(1)]; } 57 63 if(typeof value == "undefined"){ throw new Error(className+" template:"+key); } // a debugging aide 64 if(!value){ return ""; } 58 65 59 66 // Substitution keys beginning with ! will skip the transform step, … … 189 196 dijit._Templated._templateCache = {}; 190 197 191 dijit._Templated.getCachedTemplate = function(templatePath, templateString ){198 dijit._Templated.getCachedTemplate = function(templatePath, templateString, alwaysUseString){ 192 199 // summary: 193 200 // static method to get a template based on the templatePath or … … 216 223 templateString = dojo.string.trim(templateString); 217 224 218 if(templateString.match(/\$\{([^\}]+)\}/g) ){225 if(templateString.match(/\$\{([^\}]+)\}/g) || alwaysUseString){ 219 226 // there are variables in the template so all we can do is cache the string 220 227 return (tmplts[key] = templateString); //String