Available in the OSS Version

Tree - HTML Binding

This sample demonstrates how to data bind the igTree control to a static markup structure.

This sample is designed for a larger screen size.

On mobile, try rotating your screen, view full size, or email to another device.

Code View

Copy to Clipboard
<!DOCTYPE html>
<html>
<head>
    <title></title>

    <!-- Ignite UI for jQuery Required Combined CSS Files -->
    <link href="http://cdn-na.infragistics.com/igniteui/2024.2/latest/css/themes/infragistics/infragistics.theme.css" rel="stylesheet" />
    <link href="http://cdn-na.infragistics.com/igniteui/2024.2/latest/css/structure/infragistics.css" rel="stylesheet" />

    <script src="http://ajax.aspnetcdn.com/ajax/modernizr/modernizr-2.8.3.js"></script>
    <script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
    <script src="http://code.jquery.com/ui/1.11.1/jquery-ui.min.js"></script>

    <!-- Ignite UI for jQuery Required Combined JavaScript Files -->
    <script src="http://cdn-na.infragistics.com/igniteui/2024.2/latest/js/infragistics.core.js"></script>
    <script src="http://cdn-na.infragistics.com/igniteui/2024.2/latest/js/infragistics.lob.js"></script>

</head>
<body>

    <!-- The tree can easily consume this structure
    of nested UL elements for its datasource. See the
    small amount of instantiation script below. -->
    <ul id="tree">
        <li>North America
            <ul>
                <li>United States</li>
                <li>Canada</li>
                <li>Mexico</li>
            </ul>
        </li>
        <li>South America
            <ul>
                <li>Brazil</li>
                <li>Uruguay</li>
            </ul>
        </li>
        <li>Europe
            <ul>
                <li>United Kingdom</li>
                <li>Germany</li>
                <li>Bulgaria</li>
            </ul>
        </li>
    </ul>

    <script>
        $(function () {

            //This tree binds to the data defined in the HTML above
            $("#tree").igTree();

        });
    </script>

</body>
</html>