| 1 |
dojo.provide("dojox.data.demos.widgets.FileView"); |
| 2 |
dojo.require("dijit._Templated"); |
| 3 |
dojo.require("dijit._Widget"); |
| 4 |
|
| 5 |
dojo.declare("dojox.data.demos.widgets.FileView", [dijit._Widget, dijit._Templated], { |
| 6 |
|
| 7 |
|
| 8 |
templateString: dojo.cache("dojox", "data/demos/widgets/templates/FileView.html"), |
| 9 |
|
| 10 |
|
| 11 |
titleNode: null, |
| 12 |
descriptionNode: null, |
| 13 |
imageNode: null, |
| 14 |
authorNode: null, |
| 15 |
|
| 16 |
name: "", |
| 17 |
path: "", |
| 18 |
size: 0, |
| 19 |
directory: false, |
| 20 |
parentDir: "", |
| 21 |
children: [], |
| 22 |
|
| 23 |
postCreate: function(){ |
| 24 |
this.nameNode.appendChild(document.createTextNode(this.name)); |
| 25 |
this.pathNode.appendChild(document.createTextNode(this.path)); |
| 26 |
this.sizeNode.appendChild(document.createTextNode(this.size)); |
| 27 |
this.directoryNode.appendChild(document.createTextNode(this.directory)); |
| 28 |
this.parentDirNode.appendChild(document.createTextNode(this.parentDir)); |
| 29 |
if (this.children && this.children.length > 0) { |
| 30 |
var i; |
| 31 |
for (i = 0; i < this.children.length; i++) { |
| 32 |
var tNode = document.createTextNode(this.children[i]); |
| 33 |
this.childrenNode.appendChild(tNode); |
| 34 |
if (i < (this.children.length - 1)) { |
| 35 |
this.childrenNode.appendChild(document.createElement("br")); |
| 36 |
} |
| 37 |
} |
| 38 |
} |
| 39 |
} |
| 40 |
}); |