I few days ago I found myself having to build a tree of checkboxes, so the user could select items from it. Special case was that it could only have one root selected.

I found a very nice plugin – checkboxtree based on query

Unfortunetely it didnt have this specific option (single root selection)
Here is my implementation to achieve the functionality of single root selection with multiple children selected.

To Initialize:


$('#tree8').checkboxTree({
   initializeUnchecked: 'collapsed',
   multipleChildren: 'true',
   onCheck: {
      ancestors: 'check',
      descendants: 'uncheck',
      others: 'uncheck'
   },
   onUncheck: {
      descendants: 'uncheck'
   }
});

CheckBoxtree Example
jquery.checkboxtree-0.5.2.custom
patch for version 0.5.2