jQuery Tree Control

In this sample, jqxTree Items are toggle with single click.

by jqwidgets

HTML

<script src="http://jqwidgets.com/public/jqwidgets/jqxcore.js"></script>
<script src="http://jqwidgets.com/public/jqwidgets/jqxpanel.js"></script>
<script src="http://jqwidgets.com/public/jqwidgets/jqxtree.js"></script>
<script src="http://jqwidgets.com/public/jqwidgets/jqxbuttons.js"></script>
<script src="http://jqwidgets.com/public/jqwidgets/jqxscrollbar.js"></script>
<link rel="stylesheet" href="http://jqwidgets.com/public/jqwidgets/styles/jqx.base.css">
<div id="tree"></div>

JavaScript

var source = [
    {
    label: "Mail",
    expanded: true,
    items: [
        {
        label: "Calendar"},
    {
        label: "Contacts",
        selected: true}
    ]},
{
    label: "Inbox",
    expanded: true,
    items: [
        {
        label: "Admin"},
    {
        label: "Corporate"},
    {
        label: "Finance"},
    {
        label: "Other"},
        ]},
{
    label: "Deleted Items"},
{
    label: "Notes"},
{
    label: "Settings"},
{
    label: "Favorites"},
    ];

// create jqxTree
$('#tree').jqxTree({
    source: source,
    width: '250px',
    toggleMode: 'click'
});