In using the tree control, we dynamically load the tree and have external controls for navigating the tree and specifying the selected item. We use tree.focusItem() to scroll the tree to the selected item. This worked well with version 1.5 of the tree. However, now that we have upgraded to version 2.5 build 091111, we are seeing undesired behavior. Now, when we use tree.focusItem(), we see behavior that alternates between jumping to the selected item and jumping to other parts of the tree.
Is this a known bug in that build of the tree? And, is this something that has been fixed?
There is no known issues related to focusItem method
If issue still occurs for you - please provide any kind of sample or demo link where it can be reconstructed.
Attached is my testing scenario. I have included the dhtmlx tree files that I have been using. I have also included a test page that mimics part of our use of the tree.
On the test page is a button to load data into the tree (again, mimicking the way that we load the tree on the fly). We have a concept of pages and documents - the documents are listed first in the tree; the pages are listed second. When the tree is loaded, the first page is automatically selected.
As well, there is a button provided for selecting the next page in the tree. This function uses tree.selectItem() and tree.focusItem() in order to move to the next page.
Using the ‘next page’ button demonstrates where we have seen the unexpected results with using tree.focusItem().
This did solve the problems encountered on my development system. We will test it in our customer environment and let you know if we encounter any other problems. Thank you so much for your help!
I guess I spoke a little too soon. The focusItem function does work as desired. However, we can no longer drag and drop tree items into other nodes. Whenever we attempt to do so, the tree scrolls with the movement of the mouse.
This is reproducable in the test app that I previously attached with adding the updated common file. Any thoughts?
If the contents of the tree do not extend past the viewable area, then drag/drop appears to work fine. However, if you have to scroll the tree to see all of the contents, then drag/drop does not work (with using the updated dhtmlxcommon file).