将 IntraWeb IWTreeView 聚焦在所选项目上
我在 IWRegion (ClipRegion:= True) 中有一个相当长的树视图 (IWTreeView),其中一个 选定的节点。如何聚焦该节点以使其对用户可见 渲染后? 在
到目前为止我所做的:
Delphi 中
tree.Selected:= itemToFocus;
tree.ScrollToName:= tree.Selected.Name;
这会在我的网站上生成此内容(由 Atozed 的 IWTreeView.pas 完成):
<script language="javascript">
...
function initialize {
...
positionNAVIGATORTree( "i2" );
}
</script>
...
<script language="javascript">
function positionNAVIGATORTree( iNodeID )
{
FindElem( "NAVIGATOR").scrollTop =
FindElem( iNodeID ).offsetTop - 40;
return true;
}
</script>
渲染后的树仍然会显示最上面的项目。对于我测试过的所有浏览器(IE8、Firefox、Chrome)都是如此。
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).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
javascript 函数
window.scrollTo(x,y)
允许您滚动窗口,这对您的控件有用吗?The javascript function
window.scrollTo(x,y)
allows you to scroll a window, will that work for your control?Elite Suite(最近开源)具有更好的树视图(TArcIWStringGrid + TArcIWStringGridTreeContent),具有完美的工作选择和滚动功能。试试吧!
Elite Suite (recently open-sourced) has much better treeview (TArcIWStringGrid+TArcIWStringGridTreeContent) with perfectly working selection and scrolling. Try it!