Reputation: 858
I am developing a mobile application using the Dojo Toolkit. I want to make a widget of the following:
<div data-dojo-type="dojox.mobile.ListItem" data-dojoprops="moveTo:'breakdown'">
<div>Maximum: Some value</div>
</div>
I want to be able to use the widget like this:
<div data-dojo-type="dojox.mobile.RoundRectList">
<div data-dojo-type="MyWidget" data-dojo-props="maximum:'1200'"></div>
</div>
And here is what I did so far:
require(
[ "dojo/_base/declare", "dojo/parser", "dojo/ready",
"dojox/mobile/ListItem", "dijit/_WidgetBase",
"dijit/_TemplatedMixin" ],
function(declare, parser, ready, ListItem, _WidgetBase, _TemplatedMixin) {
declare("MyWidget", [ ListItem, _WidgetBase, _TemplatedMixin ], {
templateString: "<div>"
+ "<div>Maximum: <span data-dojo-attach-point='maximumNode'></span></div>"
+ "</div>",
maximum : "unknown",
_setMaximumAttr : { node : "maximumNode", type : "innerHTML" },
buildRendering : function() {
this.inherited(arguments);
}
});
ready(function() {
parser.parse();
});
});
I get no error or somthing like that, the page is not loading. What is wrong with that code?
Upvotes: 0
Views: 715
Reputation: 2053
I wrote this quick example.
From your code snippet I suspect that you might want to do something like this http://jsfiddle.net/hJJUD/7/
I recommend not changing the template from that listItem, Instead try to play with the properties it has. Take a look at this documentation http://dojotoolkit.org/reference-guide/1.8/dojox/mobile/ListItem.html
If you find that you need anything else let me know.
Upvotes: 1