Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Sudeepti M on May 30, 2008 02:48
open dhtmlx forum
Set Focus on tree view on load of the page

I have two tree views treeView1, treeView2 in a page getting displayed in separate divs.

I want to focus on treeView1 on load of the page.

I have used - treeView1.focusItem(itemId); to focus atleast rootnode of treeView1.

But it does not work.

Please help me in resolving this.


Thanks alot.

Answer posted by Support on May 30, 2008 03:02
In which moment you are executing such command?
Please beware that tree loading is async, so you need to catch moment of data loading

    tree.loadXML(url, function(){
        treeView1.focusItem(itemId);
    })


Also please be sure that tree container has not "overflow:auto" style, because in such case external scrollbars will be rendered, while tree can adjust only inner scrollbars to show item in question.