I have a rather lengthy tree view (IWTreeView) in a IWRegion (ClipRegion:= True) with one node selected. How do I focus that node such that it is visible for the user after a render? The
What I do so far:
In Delphi
tree.Selected:= itemToFocus;
tree.ScrollToName:= tree.Selected.Name;
This generates this on my website (done by IWTreeView.pas by Atozed):
<script language="javascript">
...
function initialize {
...
positionNAVIGATORTree( "i2" );
}
</script>
...
<script language="javascript">
function positionNAVIGATORTree( iNodeID )
{
FindElem( "NAVIGATOR").scrollTop =
FindElem( iNodeID ).offsetTop - 40;
return true;
}
</script>
Still the tree after a render will show the topmost item. This is true for all browsers I have tested (IE8, Firefox, Chrome).