getOperationsState();
The getOperationsState method gets the list of operation states for elements tree.
This method returns a JSON object that contains values of operation states.
To execute this example, the page must contain the DictionaryBox component named dictionaryBox (see Example of creating the DictionaryBox component ). Get tree of dictionary elements, and load root elements, if they are not loaded yet. Get the list of states for operation performed on elements tree, and show if the Add Element operation is available. Show ID of elements tree service:
// Get dictionary data area var area = dictionaryBox.getDataArea(); // Get tree of dictionary elements var tree = area.getActiveDictTree(); // Load dictionary root element, if they are not yet loaded if (!tree._Source.getChildEls("")) { tree.loadFirst(); } else { console.log("Dictionary root elements are already loaded"); } // Get the list of states of operations for elements tree var opStates = tree.getOperationsState(); // Indicate if Add elements operation is available console.log("Availability of the Add Element operation: " + opStates.AddElement) // Get ID of elements tree service console.log("ID of elements tree service: " + tree.getService().getId());
Root elements of the dictionary tree are loaded as the result. The browser console indicates if the operation of elements adding is available, and shows ID of elements tree service. If the tree root elements are already loaded the following message is shown:
Dictionary root elements are already loaded
Availability of the Add Element operation: true
ID of elements tree service: RdsService50
See also: