mbraak / jqTree

Tree widget for jQuery
https://mbraak.github.io/jqTree/
Apache License 2.0
1.02k stars 177 forks source link

checkboxes as childrens #23

Closed solowatanabe closed 12 years ago

solowatanabe commented 12 years ago

Hello there. I would like to know if it is possible to have checkboxes as childrens. I could not find any info about it.

Thanks in advance.

mbraak commented 12 years ago

JQTree does not support checkboxes. However, you can use the onCreateLi option to create checkboxes in the nodes.

See http://mbraak.github.com/jqTree/#tree-options-oncreateli for more info about the onCreateLi option.

Your code could look something like this:

$('#tree1').tree({
  data: data,
  onCreateLi: function(node, $li) {
    $li.find('.title').before('<input type="checkbox"></input');
  }
});