Radibutton in DHTMLXTree


I have Data till level 4 in my Tree control and I have enabled the radioobutton by using prop:BranchTree.enableRadioButtons(1);, which is enabling radiobutton at all the levels but I want to add these radio buttons just in front of 4th level only and should not be visisble with other levels of the tree.

I have added a function by attaching a event with my tree : BranchTree.attachEvent(“onBeforeCheck”,setDefault);

function setDefault (sourceID){

var list = BranchTree.getAllChildless();

            var AllLeaf = new Array();

            AllLeaf = list.split(",") ;

var cntDefault = 0;

var bRole = false;

if (BranchTree.getLevel(sourceID) == 4)


if (list!="")


for (var i=0;i<AllLeaf.length;i++)


if(sourceID == AllLeaf[i] )









its solving my purpose, that enebling the radiobutton select at only at 4th level, but we just want to show radiobutton other than 4th level and from all the nodes at 4th levle only one radio button should be allowd to check…

please help




the radiobutton (and checkbox) can be hidden using nocheckbox attribute in the xml:

<item nocheckbox=“1” …

or using showItemCheckbox(itemId,mode) method: