A demo to show how you can listen for the selected event.
Note: a custom property named ‘my-url’ is used here to hold an extra value for each item (see the JSON).
See a extended demo for the selected event here.
Tree Log… clear log
<![CDATA[
$(function() {
var log = $('.log div');
// write to log
$('#tree').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());
});});
]]>