CheckBox.CheckedState

Syntax

CheckedState: Boolean

Description

The CheckedState property determines state of component selection.

Comments

If the property is set to True, the component is selected. If the value is null, the component state is intermediate. When the property value is False, the component is not selected. By default the property is set to False.

To set intermediate state for component selection, set the ThreeState property to True.

Example

To execute the example, connect the PP.js library and the PP.css visual styles table. Create three instances of the CheckBox component, each of which has specific selection state:

<script type="text/javascript">

    var checkbox1 = new PP.Ui.CheckBox({

        ParentNode: document.getElementById("CB1"),

        Content: "selected"

    });

    checkbox1.setCheckedState(true);

    var checkbox2 = new PP.Ui.CheckBox({

        ParentNode: document.getElementById("CB2"),

        Content: "intermediate",

        ThreeState: true//Enable the three-state mode.

        });

    checkbox2.setCheckedState(null);

    var checkbox3 = new PP.Ui.CheckBox({

        ParentNode: document.getElementById("CB3"),

        Content: "deselected"

        });

    checkbox3.setCheckedState(false);

</script>

After executing the example the HTML page will contain CheckBox component looking as follows:

See also:

CheckBox