TreeCombo.OpenToFocused

Syntax

OpenToFocused: Boolean;

Description

The OpenToFocused property determines if the drop-down list is scrolled to the focused element when opened.

Comments

If this property is set to true, on opening the drop-down list is scrolled to the focused element.

By default this property is set to False.

Example

To execute this example, in the HEAD tag of the HTML page add links to the component library PP.js, visual styles tables PP.css, and a link to the Javascript file that contains TreeList component settings (created by developer). File with the TreeList component settings contains the following function:

var treeListSett = new PP.Ui.TreeList();

function createTreeListSettings(_Id, _ParentNode) {

    var treeListSett = {

//JSON settings of the TreeList component

        };

    return treeListSett;

};

See below an example of code for the HTML page that houses the TreeCombo component:

<body>

<div id="sample"></div>

<script type="text/javascript">

    //get JSON settings of the TreeList component from a JS file

    var TreeListSett = createTreeListSettings("sds");

    //do not use JSON settings of component width and height

    delete TreeListSett.Width;

    delete TreeListSett.Height;

    //enable the multiple selection for the TreeList component

    TreeListSett.MultiSelect = true;

    //create TreeCombo component

    var treecombo1 = new PP.Ui.TreeCombo({

        ParentNode: document.getElementById("sample"),

        //set the TreeList component to the dropdown part of the TreeCombo component

        TreeList: TreeListSett,

        Width: "250px",

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #008000;">//on opening of the <a href="../../components/treecombo/treecombo.htm">TreeCombo</a></span><span style="color: #008000;"> component drop-down part, the list is scrolled to the focused item</span>

        OpenToFocused: true

    });

</script>

</body>

After executing the example, the TreeCombo component is located on the HTML page. On opening, drop-down list is scrolled up to focused element.

See also:

TreeCombo