DataView: Object
The DataView property determines wizard data source.
Use JSON or the setCaption method to set the property value, and the getCaption method to get the property value. The setCaption method has the following parameters: value - data source view, clearOld - indication that determines whether to clear views added before. By default it is set to true.
To execute the example the HTML page must contain the TreeMap component named treeMap and the component TreeMapMaster named «treeMapMaster» (see «Example of the TreeMapMaster and TreeMap Component Layout» ). Process the PropertyChanged event, set a new object that represents a data source of the wizard with changed opacity value, show IDs of color, legend and size panels:
// Process the PropertyChanged event treeMapMaster.PropertyChanged.add(function (sender, args, timeout) { console.log("The PropertyChanged event is initiated") }); // Get the object representing a data source of the wizard var dataView = treeMapMaster.getDataView(); // Change the opacity value of obtained object dataView[0].setOpacity(0.7); // Set a new object that represents a data source of the wizard treeMapMaster.setDataView(dataView, true); // Fire the event treeMapMaster.PropertyChanged.fire(this); // Get the color panel var colorPanel = treeMapMaster.getColorPanel(); // Show panel ID console.log("Color panel ID: " + colorPanel.getId()); // Get the legend panel var legendPanel = treeMapMaster.getLegendPanel(); // Show panel ID console.log("Legend panel ID: " + legendPanel.getId()); // Get size panel var sizePanel = treeMapMaster.getSizePanel(); // Show panel ID console.log("Size panel ID: " + sizePanel.getId());
After executing the example opacity of the object that represents the wizard data source is changed:
The browser console shows a message informing that processed event has been fired, and also IDs for color panel, legend panel and size panel:
PropertyChanged event initialized
Color panel ID: TreeColorPanel762
Legend panel ID: TreeLegendPanel632
Size panel ID: TreeSizePanel892
See also: