Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by n.darques on Jan 30, 2009 04:25
open dhtmlx forum
dhtmlxTree in a dhtmlxLayout with enableKeyboardNavigation on = scrollbar bug

Hi guys,

I've just noticed that when you insert a tree in a layout component (attachContent function not attachTree function), with 'keyboard navigation' enabled, a bug happens.
You have to have a big tree, enough to overflow your layout cell and make scrollbar appears.
If you try to select one of the bottom node, that is to say with scrollbar not in top position, by clicking on it, it correctly selects the node but the scrollbar goes back to top.

It's very annoying, any way to quick fix this ?
Answer posted by Support on Jan 30, 2009 05:28
Problem already fixed in latest codebase ( update and sample sent by email ) 
Answer posted by n.darques on Jan 30, 2009 08:21
Sample tested and reproduced on my application.
Thing is, it's only fixed if I insert my tree into layout cell with 'attachTree'.
Whith this code, it's still not working :

HTML  CODE :
<div id="mainLayoutBox" style="position:relative;top:0px;left:0px;width:100%;height:550px;"></div>
</div>


<div id="treeCell" style="width:100%;height:100%;overflow:auto;display:none;">
    ....
    <div id="treeBox" style="padding:1px; overflow:hidden"></div>
    ....
</div>


JAVASCRIPT INIT
var cLayout = new dhtmlXLayoutObject("mainLayoutBox","3U","dhx_grey");
cLayout.setImagePath("LIB/JAVASCRIPT/dhtmlxSuite_2008Rel3_pro_81009/dhtmlxLayout/codebase/imgs");
cLayout.cells("a").attachObject("
treeCell");

var cTree=new dhtmlXTreeObject("treeBox","100%","100%",0);
cTree.setImagePath("LIB/SKIN/CLASSIC/MEDIA/dhtmlx/");
cTree.enableKeyboardNavigation(true)
cTree.loadXML(...);


I know that 'attachTree' seems to be a much more reliable and fast solution but I have to keep tree into a separate 'div' as I have extra content and infos floating around, or over, it (loading overlay, filter options... etc).
I'm open ton any suggestions.

Thanks for your attention.




Answer posted by Support on Feb 03, 2009 03:28
Please try to use attached js file instead of original one - it must resolve issue with unwanted auto scrolling
Attachments (1)
Answer posted by n.darques on Feb 03, 2009 05:06
Problem solved.
Thanks a lot.