setFilter(textFilter: Object);
textFilter. JSON object that contains filter settings.
The setFilter method sets filter used to find elements in the tree.
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, process the NodesFiltered event. Define and set filter:
// Get dictionary data area var area = dictionaryBox.getDataArea(); // Get tree of dictionary elements var tree = area.getActiveDictTree(); // Process the NodesFiltered event tree.NodesFiltered.add(function (sender, eventArgs) { console.log("NodesFiltered event initialized"); }); // Define filter var filter = { caseSensitive: false, text: "Decade" }; // Set the filter tree.setFilter(filter);
A data search filter is set as the result:
The browser console shows a message that the processed event was invoked:
NodesFiltered event initialized
See also: