Location: A review of cardiac cellular electrophysiology models @ f954e5918331 / dojo-presentation / js / dojo / dojox / wire / demos / WidgetRepeater.js

Author:
David Nickerson <david.nickerson@gmail.com>
Date:
2021-09-16 00:41:19+12:00
Desc:
Updating Noble 1962 model: * Exposing the membrane potential to the top-level model; * adding SED-ML for the paced and pacemaker variants of the model. Using OpenCOR Snapshot release 2021-09-14.
Permanent Source URI:
https://models.fieldml.org/workspace/a1/rawfile/f954e59183314cd37f86c8832dc81317d01c8ec5/dojo-presentation/js/dojo/dojox/wire/demos/WidgetRepeater.js

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);
				this.widget = dojo.getObject(this.widget);
			}
			this.addChild(new this.widget(obj));
			this.repeaterNode.appendChild(document.createElement("br"));
		}catch(e){ console.debug(e); }
	}
});