The first step is to create html page and add links to the javascript files and css dependencies to your project. The jqxTree widget requires the following files:
$("#jqxTree").jqxTree(‘selectItem’, html element);
To get the result of a function(method) call, you need to pass the method name in
the jqxTree’s constructor and parameters(if any).
$("#jqxTree").jqxTree(‘getItem’, html element );
To set a property(option), you need to pass the property name and value(s) in the
jqxTree's constructor.
$("#jqxTree").jqxTree({ checkboxes: true });
To get a property(option), you need to pass the property name to the jqxTree's constructor.
var checkboxes = $("#jqxTree").jqxTree('checkboxes');
To bind to an event of a UI widget, you can use basic jQuery syntax. Let’s suppose
that you want to get the selected item when the user clicks. The example code below
demonstrates how to bind to the ‘select’ event of jqxTree.
$('#jqxTree').on('select', function (event) {
var args = event.args;
var item = $('#jqxTree').jqxTree('getItem', args.element);
alert("Selected: " + item.label);
});
$("#jqxTree").jqxTree('checkItem', $("#home")[0], true);
The last parameter in the above code is the checked state.
$("#jqxTree").jqxTree('selectItem', $("#home")[0]);
var items = $("#jqxTree").jqxTree('getItems');
To get an item by LI tag, use the following code:
var item = $("#jqxTree").jqxTree('getItem', $("#home")[0]);