Deserializes items from a JSON string.
Namespace: MindFusion.Common.UI
File: ListContainer.js
JavaScript Copy Code |
---|
function fromJson (json) |
String. A string created by the toJson method.
The following code loads a ToolStrip, which is of type ListContainer, from a Json file:
JavaScript Copy Code |
---|
// create a new instance of the ListContainer control var toolstrip = new ui.ToolStrip(document.getElementById("listcontrol")); toolstrip.width = new ui.Unit(100, ui.UnitType.Pixel); toolstrip.height = new ui.Unit(100, ui.UnitType.Percent); toolstrip.itemSize = new ui.Unit(50); toolstrip.orientation = ui.Orientation.Vertical; toolstrip.collapsible = true; toolstrip.scrollable = false; toolstrip.theme = theme; toolstrip.fromJson("myJsonFile.json"); |