DataArea.getActiveFindBox

Syntax

getActiveFindBox();

Description

The getActiveFindBox method returns a container for searching MDM dictionary elements on the active tab.

Comments

This method returns a PP.Rds.Ui.FindBox object.

Example

To execute this example, the page must contain the DictionaryBox component named dictionaryBox (see Example of creating the DictionaryBox component ). Show the container for searching MDM dictionary elements, show the number of child elements for its data source, filter them by the Second string, and handle the ActiveTreeEdited event:

// Get dictionary data area
var dataArea = dictionaryBox.getDataArea();
// Get active container to search for dictionary elements
var findBox = dataArea.getActiveFindBox();
// Show this container
dataArea.showFindBox();
// Show the number of elements in the search container data source
console.log("Number of elements in the search container data source: " + 
    findBox.getSource().getChildEls().length);
// Process the FindChanged event
findBox.FindChanged.add(function (sender, args) {
    console.log("Filter text: %s", args.Filter.text);
});
// Process the ActiveTreeEdited event
dataArea.ActiveTreeEdited.add(function (sender, args) {
    console.log("View of the current dictionary has been changed");
});
// Get search options
var filterSettings = findBox.getFilterSettings();
// Filter elements by the text "Second"
filterSettings.text = "Second";
findBox.setFilterSettings(filterSettings, true);
// Get search bar
var findTextBox = findBox._FindTextBox;
// Set the text in this bar
findTextBox.setContent(filterSettings.text);
// Apply the filter
findTextBox.Enter.fire(findTextBox);

After executing the example the container for searching MDM dictionary elements is shown, the browser console shows the number of child elements in its data source, and elements of this dictionary are filtered by the Second string:

After the ActiveTreeEdited event handler fires, the browser console shows a message that view of the current dictionary has been changed.

Now hide the container for searching MDM dictionary elements:

dataArea.hideFindBox();

After executing the specified script line this container is hidden, and the applied filter is reset:

The browser console shows the same message.

See also:

DataArea