我在一个单独的.html文件中有一个基于模板的dojo小部件和一个HTML模板.
Dojo小部件:
define("dojow/SomeWidgetName",[
"dojo/_base/declare",
"dijit/_WidgetBase",
"dijit/_TemplatedMixin",
"dojo/text!./templates/MyHTMLFile.html"], function(declare, _WidgetBase, _TemplatedMixin, template) {
return declare([_WidgetBase, _TemplatedMixin], {
templateString: template,
baseClass: 'dojowBaseClass',
details:{} // THIS IS THE OBJECT THAT WILL BE LOOPED
// your custom code goes here
});});
Run Code Online (Sandbox Code Playgroud)
HMTL模板:
<table>
<tr>
<td>SomeService</td>
<td>someUsername</td>
</tr> </table>
Run Code Online (Sandbox Code Playgroud)
我需要的是根据我在dojo小部件中的"details"对象重复表的行,因此每行包含来自该对象的数据.那可能吗?
谢谢.