Html Tree

Invoke the getUncheckedItems method of the jqxTree. Author: http://jqwidgets.com

by jqwidgets

HTML

<link rel="stylesheet" href="https://jqwidgets.com/public/jqwidgets/styles/jqx.base.css">
<script src="https://jqwidgets.com/public/jqwidgets/jqx-all.js"></script>
<link rel="stylesheet" href="https://jqwidgets.com/public/jqwidgets/styles/jqx.energyblue.css">
<div id='jqxTree'>
    <ul>
        <li item-selected='true'>Home</li>
        <li item-expanded='true'>Solutions
            <ul>
                <li>Education</li>
                <li>Financial services</li>
                <li id="government">Government</li>
                <li>Manufacturing</li>
                <li>Solutions
                    <ul>
                        <li>Consumer photo and video</li>
                        <li>Mobile</li>
                    </ul>
                </li>
                <li>All industries and solutions</li>
            </ul>
        </li>
    </ul>
</div>
<input type="button" style="margin: 50px;" id="jqxbutton" value="Get the checked items" />

JavaScript

$('#jqxTree').jqxTree({
       height: '300px',
       width: '300px',
       theme: 'energyblue',
       checkboxes: true
   });
   $("#jqxbutton").jqxButton({
       theme: 'energyblue',
       width: 200,
       height: 30
   });

   var newCheckState = true;
   $("#jqxTree").jqxTree('checkItem', $("#government")[0], newCheckState);
   $('#jqxbutton').click(function () {
       var str = "";
       var items = $('#jqxTree').jqxTree('getUncheckedItems');
       for (var i = 0; i < items.length; i++) {
           var item = items[i];
           str += item.label + ",";
       }
       alert("The unchecked items are " + str);
   });