hi,
I am using a dhtmlxtree. wch works fine,bt a small prob. is tht ,at the very first time it doesn’t show me plus minus(+/-) sign.
In place of (+/-) it is showing a image “blank.gif”. wen i click on tht area den it shows me (+/-)sign as usual.But dis prob. continue wid it’s child node ,means if a child node also have its child den at d first time it is indicating by blank image again & same like above on d click of tht blank image i am able to show (+/-) sign respectively.I want 2 show plus minus sign in the starting as d tree loaded.Can u help me.
plz also send a sample code.
thnkx
<script language=‘javascript’>
mytree = new dhtmlXTreeObject(“treebox”,“100%”,“95%”,‘0’);
mytree.setImagePath("<%=appName%>/tpc/dhtmlx/dhtmlxTree/codebase/imgs/");
mytree.enableTreeLines(false);
//mytree.enableTreeImages(true);
//mytree.enableTextSigns(“true”);
mytree.enableHighlighting(true);
mytree.showItemSign(“treebox”,true);
mytree.setIconSize(12,12);
mytree.setOnClickHandler(openUnits);
mytree.setOnOpenHandler(edit4TreeGrid);
mytree.insertNewChild(‘0’,‘1^<%=TGlobalServlet.topUnitId%>’,’<%=TGlobalServlet.topUnitId%>’, 0,0,0,0,“TOP,CHILD”);
mytree.setUserData(‘1^<%=TGlobalServlet.topUnitId%>’,“ORG_LEVEL”,1);
mytree.openAllItems();
hideLoadingMsg();
</script>
======================================
function edit4TreeGrid(unitId,open)
{
if(open==0){
parForTree= unitId;
var parUnit = unitId.split(’^’);
var orgLevel = mytree.getUserData(unitId,“ORG_LEVEL”)
HRService.getUnitsDetails(<%=ownerId%>,’<%=clientId%>’,parUnit[1],orgLevel,callBackTree);
}
else
{
return true;
}
}
=============================================
function callBackTree(data)
{
for(var i=0; i<data.length;i++)
{
var dataArr = data[i];
mytree.insertNewChild(parForTree,dataArr[4]+"^"+dataArr[0],dataArr[1],0,0,0,0,“TOP,CHILD”);
mytree.setUserData(dataArr[4]+"^"+dataArr[0],“ORG_LEVEL”,dataArr[4]);
}
}