Is it possible to code a view programatically instead of using an html template? All the demos I have seen use an html template.
Dojox/app: Is it possible to define views programatically
57 Views Asked by bobmanc At
2
There are 2 best solutions below
0
On
You can also use placeholder's in your HTML template having defined basic tag structure in template and providing value's to the placeholder from JS side.
Ex:
<div>
<div data-dojo-type="dojox.layout.contentpane" >
{content}
</div>
</div>
OR
You may also modify some HTML template dynamically from "postMixInProperties()"
Refer to Widget Life cycle to get some info on that http://dojotoolkit.org/reference-guide/1.10/dijit/_WidgetBase.html
Yes it is possible. Add your HTML markup as a string for property
templateString, the following code does not use an .html template as for your question. You can use string concatenation in order to modify your template programatically.More information on templateString here.
Example below is taken from user Ben from this answer to a my older question: