Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Marta on May 11, 2009 07:46
open dhtmlx forum
tree in treegrid

I'm trying to place a tree in a treegrid column using stree
In the grid the value of the column is replaced with the text but if I doubleclick the cell no tree appears, it just sort of flashes but nothing happens
I had to add dhtmlxgrid_excell_tree.js (I'm using the full pro js)
Thanks for any help!
This is my code:
    mygrid = new dhtmlXGridObject('gridbox');
    mygrid.setSkin("modern");
    mygrid.attachEvent("onEditCell",doOnCellEdit);
    mygrid.attachEvent("onEnter",doOnEnter);
    mygrid.attachEvent("onRowSelect",LoadProperties);
... other events ..
    mygrid.imgURL = "/js/dhtmlx/imgs/";
    mygrid.enableDragAndDrop(true);
    var tree=new dhtmlXTreeObject('treeBox',"100%","100%",0);
    if (coltree.length) {
        tree.loadXML("/xml/tree.exml?table="+tabtree, function(){
                mygrid.setSubTree(tree,4); //here I also put setSubTree(tree,4,0) but no change
                mygrid.loadXML("/xml/treegrid.exml?table="+n+'&tipo='+tipo)
                mygrid.init();
        });
    }
    else mygrid.loadXML("/xml/treegrid.exml?table="+n+'&tipo='+tipo);
Answer posted by dhxSupport on May 11, 2009 08:40

Please check if in your grid 4th column has type "stree". Also order of a command should be following:

 if (coltree.length) { 
  tree.loadXML("/xml/tree.exml?table="+tabtree, function(){ 
  mygrid.setSubTree(tree,4); 
  mygrid.init(); 
  mygrid.loadXML("/xml/treegrid.exml?table="+n+'&tipo='+tipo) 
 
  }); 
  } 
  else{
mygrid.init();
mygrid.loadXML("/xml/treegrid.exml?table="+n+'&tipo='+tipo);
}


If issue still occurs please provide us sample where we can reprodue it. You can send sample directly to the support@dhtmlx.com