diff options
| author | Tristan Zur <tzur@web.web.ccwn.org> | 2014-03-27 22:27:47 +0100 |
|---|---|---|
| committer | Tristan Zur <tzur@web.web.ccwn.org> | 2014-03-27 22:27:47 +0100 |
| commit | b62676ca5d3d6f6ba3f019ea3f99722e165a98d8 (patch) | |
| tree | 86722cb80f07d4569f90088eeaea2fc2f6e2ef94 /js/dojo/dojox/wire/demos/WidgetRepeater.js | |
Diffstat (limited to 'js/dojo/dojox/wire/demos/WidgetRepeater.js')
| -rw-r--r-- | js/dojo/dojox/wire/demos/WidgetRepeater.js | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/js/dojo/dojox/wire/demos/WidgetRepeater.js b/js/dojo/dojox/wire/demos/WidgetRepeater.js new file mode 100644 index 0000000..2fb7d67 --- /dev/null +++ b/js/dojo/dojox/wire/demos/WidgetRepeater.js @@ -0,0 +1,34 @@ +//>>built +// wrapped by build app +define("dojox/wire/demos/WidgetRepeater", ["dijit","dojo","dojox","dojo/require!dojo/parser,dijit/_Widget,dijit/_Templated,dijit/_Container"], function(dijit,dojo,dojox){ +dojo.provide("dojox.wire.demos.WidgetRepeater") + +dojo.require("dojo.parser"); +dojo.require("dijit._Widget"); +dojo.require("dijit._Templated"); +dojo.require("dijit._Container"); + +dojo.declare("dojox.wire.demos.WidgetRepeater", [ dijit._Widget, dijit._Templated, dijit._Container ], { + // summary: + // Simple widget that does generation of widgets repetatively, based on calls to + // the createNew function and contains them as child widgets. + templateString: "<div class='WidgetRepeater' dojoAttachPoint='repeaterNode'></div>", + widget: null, + repeater: null, + createNew: function(obj){ + // summary: + // Function to handle the creation of a new widget and appending it into the widget tree. + // obj: + // The parameters to pass to the widget. + try{ + if(dojo.isString(this.widget)){ + // dojo.require(this.widget); confuses new AMD builder, include resource manually first + this.widget = dojo.getObject(this.widget); + } + this.addChild(new this.widget(obj)); + this.repeaterNode.appendChild(document.createElement("br")); + }catch(e){ console.debug(e); } + } +}); + +}); |
