dijit.layout.ContentPane._setContent
dojo.require("dijit.layout.ContentPane");
defined in dijit/layout/ContentPane.js
Usage
function (cont) (view source)
this.destroyDescendants(); try{ var node = this.containerNode || this.domNode; while(node.firstChild){ dojo._destroyElement(node.firstChild); } if(typeof cont == "string"){ // dijit.ContentPane does only minimal fixes, // No pathAdjustments, script retrieval, style clean etc // some of these should be available in the dojox.layout.ContentPane if(this.extractContent){ match = cont.match(/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im|>); if(match){ cont = match[1]; } } node.innerHTML = cont; }else{ // domNode or NodeList if(cont.nodeType){ // domNode (htmlNode 1 or textNode 3) node.appendChild(cont); }else{// nodelist or array such as dojo.Nodelist dojo.forEach(cont, function(n){ node.appendChild(n.cloneNode(true)); }); } } }catch(e){ // check if a domfault occurs when we are appending this.errorMessage // like for instance if domNode is a UL and we try append a DIV var errMess = this.onContentError(e); try{ node.innerHTML = errMess; }catch(e){ console.error('Fatal '+this.id+' could not change content due to '+e.message, e); } }
parameter | type | description |
---|---|---|
cont |