View Full Version : TreePanel problem - odd behaviour when view is scrolled down

20 May 2007, 2:30 PM
Just to provide a background, I have a BorderLayout applied to a DIV element, positioned relative, and auto-stretches to a percentage of the overall screen width. This has worked fine. Also, the DIV has the Height set dynamically: window.innerHeight - div top offset - spacing at the bottom. Split into two panels, the west panel contains a treePanel (with autoscroll and allowDD set to true) and the toolbar. So far, everything has worked fine, apart from this issue:

When the TreePanel is at the top of the scroll view (or if there is no scrollbar at all because the content is not longer than the panel height), drag and drop works fine, as does the TreeEditor - the edit box appears aligned, and it is possible to move items between (to 'insert' before an existing node) - the line to insert appears.

When the TreePanel is scrolled downwards, even if it is one line, the ability to 'insert' disappears, however, it is still possible to append the node to a different branch (this just appends to the bottom of that branch).

As for the TreeEditor, it will appear below relative to the node text element exactly the amount that is scrolled, so i.e. if the TreePanel is scrolled half a line down, the editor will appear covering half of the node text; the upper half of the text can be seen. Likewise, if the TreePanel is scrolled around 100pixels down from the top of the tree, the Editor will appear 100 pixels below the top of the node text.

I tried removing some of the CSS rules, especially position: relative from the parent elements of the layout, but it still has these issues. I notice that the demos in the Ext documentation work fine when there is scrolling involved, but they are mostly applied to a fixed element size.

I've uploaded a snapshot; notice the scroll offset, and the correlation to the TreeEditor box:


I won't be able to provide a test version of the page right now, though possibly later this week if necessary.

Any idea what could be causing this, with the information provided so far?