MetabaseObjectsListView.invertSelection

Syntax

invertSelection();

Description

The invertSelection method inverts selection of container elements.

Comments

The method selects not selected elements and deselects elements that were selected.

Example

To execute the example, the HTML page must contain the MetabaseObjectsListView component named list (see Example of Creating the MetabaseObjectsListView Component).

In the BODY tag add a div element with the div1, div2, div3 identifiers:

<body>
        <div id="div1"></div>
        <div id="div2"></div>
        <div id="div3"></div>
</body>

Add the but1, but2 and but3 buttons to the page, process button click events:

// A button selects all container elements
var but1 = new PP.Ui.Button({
    ParentNode: document.getElementById("div1"),
    Content: "Select all"
})
but1.Click.add(function (sender, args) {
    list.selectAll();
})
// A button deselects all container elements
var but2 = new PP.Ui.Button({
    ParentNode: document.getElementById("div2"),
    Content: "Deselect all"
})
but2.Click.add(function (sender, args) {
    list.deSelectAll()
})
// A button inverts selection
var but3 = new PP.Ui.Button({
    ParentNode: document.getElementById("div3"),
    Content: "Invert selection"
})
but3.Click.add(function (sender, args) {
    list.invertSelection()
})

After executing the example the following buttons are placed:

See also:

MetabaseObjectsListView