Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by ankit on Jun 14, 2009 21:49
open dhtmlx forum
unable to show (+/-) sign

hi ,
I still can't able to resolve d prob. I am using below two funtions to retrive data from database in order to add childs for a selected or expanded parent node on d click of plus sign.
That code is works fine as long as i use
mytree.setOnOpenHandler(edit4TreeGrid);
but as u suggest
        mytree.setXMLAutoLoading(edit4TreeGrid);
     mytree.setXMLAutoLoadingBehaviour("function");

to be used for showing (+/-) sign during dynamic loading ,my functions i.e.( edit4TreeGrid) doesn't work. it only calls for d first time .i can't able to see d childs of selected parent node.
I am sending u my code , now can u sort tht prob.

thnkx
=========================================================================

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];
            
            //var unitLnk = "<a href=# class=tblrow-grid-sp onclick=\"javascript:edit(\'"+dataArr[0]+"\')\">"+dataArr[1]+"</a>";
            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]);
        
    }
    
}
Answer posted by Alex (support) on Jun 14, 2009 23:36

Hello,

in case of using dynamic loading -   mytree.setXMLAutoLoading(edit4TreeGrid), there is only one parameter - an id of an item that should be loaded. We mentioned in our previous answer the following code (1 parameter - there shouldn't be check on open state):

function edit4TreeGrid(unitId
{
...

}