A JSON content handler.
This module is a content handler that creates a view from JSON data. If widgets used in the JSON data are not available, they are loaded automatically before instantiation.
There are two formats as shown in the examples below. You can choose either of them. The v1.7 format can be more compact, but if you want multiple widgets at the same level, they must be in an array. So, you can have, for example, two consecutive RoundRectLists, but you cannot have, for example, RoundRectCategory, RoundRectList, RoundRectCategory, and RoundRectList, because they are keys in one JS object, which causes conflict. The v1.8 format has no such limitation.
// v1.7 format { "dojox.mobile.View": { "@id": "view1", "dojox.mobile.Heading": { "@back": "Home", "@moveTo": "home", "@label": "view1.json" }, "dojox.mobile.EdgeToEdgeList": { "dojox.mobile.ListItem": [{ "@label": "Jack Coleman" }, { "@label": "James Evans" }, { "@label": "Jason Griffin" }] } } }
// v1.8 format { "class": "dojox.mobile.View", "@id": "view1", "children": [ { "class": "dojox.mobile.Heading", "@back": "Home", "@moveTo": "home", "@label": "view1.json" }, { "class": "dojox.mobile.EdgeToEdgeList", "children": [ { "class": "dojox.mobile.ListItem", "@label": "Jack Coleman" }, { "class": "dojox.mobile.ListItem", "@label": "James Evans" }, { "class": "dojox.mobile.ListItem", "@label": "Jason Griffin" } ] } ] }
// SpinWheel in v1.8 format { "class": "dojox.mobile.View", "@id": "view1", "children": [ { "class": "dojox.mobile.SpinWheel", "@id": "spin1", "@style": {"margin":"10px auto","width":"304px"}, "children": [ { "class": "dojox.mobile.SpinWheelSlot", "@labels": "A,B,C,D,E", "@style": {"textAlign":"center","width":"300px"} } ] } ] }
Parameter | Type | Description |
---|---|---|
obj | undefined |
Given the evaluated json data, does the same thing as what the parser does.
Parameter | Type | Description |
---|---|---|
obj | Object | |
node | DomNode | |
parent | Widget |
Parameter | Type | Description |
---|---|---|
root | undefined |
Parses the given data and creates a new view at the given position.
Parameter | Type | Description |
---|---|---|
content | Object | Content data for a new view. |
target | DomNode | A DOM node under which a new view is created. |
refNode | DomNode |
Optional An optional reference DOM node before which a new view is created. |