Source: PP.Rds.Dictionary;
The Source property determines data source for the tree of dictionary elements.
Use JSON or the setSource method to set the property value, and the getSource method to get the property value.
To execute this example, the page must contain the DictionaryBox component named dictionaryBox (see Example of creating the DictionaryBox component ). Get dictionary elements tree and process the Refreshed event. Show name of the tree data source and displayed attribute of the dictionary tree, if there is any, set the best width for the tree columns and refresh the tree:
// Get dictionary data area var area = dictionaryBox.getDataArea(); // Get tree of dictionary elements var tree = area.getActiveDictTree(); // Process the Refreshed event tree.Refreshed.add(function (sender, eventArgs) { console.log("Refreshed event initialized"); }); // Get data source var source = tree.getSource(); // Show data source name console.log("Name of elements tree data source: " + source.getName()); // Show displayed attribute of dictionary tree if it is available if (tree.getDisplayAttrId() != null) { console.log("Displayed attribute of dictionary tree: " + tree.getDisplayAttrId()); } // Set optimum width of tree columns tree.adjustColumnWidth() // Refresh the tree of elements tree.refresh();
As the result the best width is set for the tree columns:
The browser console shows a message informing that the processed event has been fired. It also shows data source name and name of the displayed tree attribute, if there is any:
Name of elements tree data source: Time units
Refreshed event initialized
See also: