Debian Codegraph @

dojox/wire/demos/WidgetRepeater.js

raw symbols SCIP
1 dojo.provide("dojox.wire.demos.WidgetRepeater")
2
3 dojo.require("dojo.parser");
4 dojo.require("dijit._Widget");
5 dojo.require("dijit._Templated");
6 dojo.require("dijit._Container");
7
8 dojo.declare("dojox.wire.demos.WidgetRepeater", [ dijit._Widget, dijit._Templated, dijit._Container ], {
9 // summary:
10 // Simple widget that does generation of widgets repetatively, based on calls to
11 // the createNew function and contains them as child widgets.
12 templateString: "<div class='WidgetRepeater' dojoAttachPoint='repeaterNode'></div>",
13 widget: null,
14 repeater: null,
15 createNew: function(obj){
16 // summary:
17 // Function to handle the creation of a new widget and appending it into the widget tree.
18 // obj:
19 // The parameters to pass to the widget.
20 try{
21 if(dojo.isString(this.widget)){
22 // dojo.require(this.widget); confuses new AMD builder, include resource manually first
23 this.widget = dojo.getObject(this.widget);
24 }
25 this.addChild(new this.widget(obj));
26 this.repeaterNode.appendChild(document.createElement("br"));
27 }catch(e){ console.debug(e); }
28 }
29 });