Filter: String;
setFilter (value: String|PP.Mb.DimFilter, filterAttr: Array|String, filterType: PP.Mb.Ui.DimFilterType, caseSensitive: Boolean);
getFilter ();
Parameters of the setFilter method:
value. Row to be used to filter dimension elements.
filterAttr. Array of attributes to be filtered.
filterType. Filter type.
caseSensitive. Determines if the filter is case-sensitive.
The Filter property sets filter for items of dictionary tree.
Use JSON or the setFilter method to set the property value and the getFilter method to get the property value.
To execute the example, the HTML page must contain the DimTree component (see Example of Creating the DimTree Component). In the BODY tag add the DIV element with the Div2 identifier. Add a button named button1, clicking which applies filter:
var button1 = new PP.Ui.Button({ ParentNode: document.getElementById("Div2"), Content: "Filter" }); button1.Click.add(function (sender, args) { // Enable highlighting of a filtered string of elements dimTree.setFilterHighlight(True); // Perform filtering dimTree.setFilter("200", "NAME", "Contains"); });
After executing the example on clicking the button tree elements are filtered: only the elements whose name contain the string 200 and their parents remain in the tree. The string 200 is selected:
Clicking the button loads child nodes that contain the string defined in filter parameters. To find out the lowest level loaded, execute the following code fromthe console:
console.log("The lowest level loaded: " + dimTree.getSource().getMaxLoadedLevel());
Index of the lowest loaded level is shown.
See also: