Skip to content

This is a demo to show you using aciTree with checkboxes. The checkbox flag need to be set for each item into the JSON data when
both checkbox and radio extensions are included.
By default, all items will have a checkbox (if checkbox is missing from the JSON data).

When a checkbox is checked, all children from each level under the selected one will be checked by default. Also, the parents
will be checked all the way up to the root item.
This functionality will break once there is a missing checkbox (with the default options set).
In this way you can form checkbox groups.

Note: When loading nodes, the checked/unchecked state need to be correctly set in the JSON data.

see the JSON behind this tree

The easy way to find a car that’s right for you
see the JSON behind this tree

With checkbox + radio button sample
Tree Log… clear log

<![CDATA[

$(function() {

var log = $('.log div');

// write to log
$('#tree,#tree-combined').on('acitree', function(event, api, item, eventName, options) {
if (api.isItem(item)) {
log.prepend('

‘ + eventName + ‘ [‘ + api.getId(item) + ‘]’);
} else {
log.prepend(‘

‘ + eventName + ‘ [tree]’);
}
});

$(‘.clear_log’).click(function() {
$(‘.log div’).html(”);
return false;
});

});

]]>

<![CDATA[

$(function() {

$('script.code').each(function() {
$(this).before('

');
$(this).prev('div').find('pre').text($(this).html());
});

});

]]>

error: El contenido de este sitio está protegido