Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by janet on Jul 17, 2009 13:37
open dhtmlx forum
treegrid colspan and setvalue

Hi,
1)
in dhtmlxtreegrid the first level node has a long text. So I want to use colspan. How do I configure in script?

2)
How can I change the value of nodes in treegrid? I tried

mygrid.cellById(1,2).setValue("New_Value");
and
mygrid.cell(1,2).cell.innerHTML.setValue("New_Value");

but no success.

Thanks for help.
Answer posted by dhxSupport on Jul 20, 2009 05:36

1) Unfortunately there is no way colspan "tree" cells
2) Fist parameter of cellById is id of a row. So you should use:
mygrid.cellById("1",2).setValue("New_Value");

Answer posted by janet on Jul 21, 2009 01:50

1) solved with xml. OK

2) Unfortunatly it doesn't work. There is an Error: _childindexes are Null or not an object. Is anything wrong in the attached file?

My script:

       []
        mygrid.init();

        mygrid.loadXML("test_list.xml");

        //change Values
        
        //sample1
        mygrid.cellById(??,??).setValue("new_Value");
        //sample2
        mygrid.cellById(??,??).setValue("new_Value");
        //sample3
        mygrid.cellById(??,??).setValue("new_Value");

thanks for help

Attachments (1)
test_list.xml1002.00 B
Answer posted by dhxSupport on Jul 21, 2009 09:48
cellById() method should be called only after treeGrid was fully loaded:
mygrid.loadXML("test_list.xml",function(){
 //sample1
  mygrid.cellById(??,??).setValue("new_Value");
  //sample2
  mygrid.cellById(??,??).setValue("new_Value");
  //sample3
  mygrid.cellById(??,??).setValue("new_Value");
});

In your xml file rows has ids: "1214", "1213", "1212"... So you should use:
mygrid.cellById("1214",0).setValue("new_Value");