通过javascript为treeview节点添加事件 [英] add events for treeview node through javascript

查看:93
本文介绍了通过javascript为treeview节点添加事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基督徒,

非常感谢您的快速回复... ya ..我尝试过..一些自己的工具提示,因为树视图的默认工具提示不适合我...我的工具提示正在工作..罚款..但是我的问题在treeview本身的鼠标悬停...但是我需要的是,仅当我将鼠标放在 Node 上时才必须将其触发.(如果我将鼠标放在父节点上.显示其子节点的详细信息).因此需要
我只需要在节点鼠标悬停时触发事件...通过JavaScript而不是背后的代码有任何解决方案吗?
Iam非常热切地等待帮助..pls满足了需求

在此先感谢
Rajesh

Hi christian,

Thank u very much for ur quick replies...ya..i tried..some own tooltip as default tooltip for treeview was not suited me...my tooltip is working..fine..but my problem it is fired on the mouseover of the treeview itself...but wat i need is, it must be fired only when i place the mouse on the Node .(If i place the mouse on the parent node..the tooltip must show its childnodes details)..So for that need
i need to fire the event only on node mouseover...Is there any solution through javascript instead of code behind...
Iam very much eagerly waiting for the help..pls do the need

Thanks in advance
Rajesh

推荐答案

事件需要在后面的代码中创建,以便事件触发,因为否则在恢复viewstate时它们将不存在.因此,即使您复制了通常事件中存在的javascript,也不会触发.对于我来说,这些事件似乎都没有客户端版本,RenderPreText和RenderPostText方法似乎是向客户端添加客户端事件的最可能方法.
The events need to be created in the code behind, in order for them to fire, because otherwise they will not exist when viewstate is restored. Therefore, even if you copied the javascript that exists for a usual event, it would not fire. None of the events seem to have a client side version, the RenderPreText and RenderPostText methods seem like the most likely way to add a client side event to a node, to me.


TreeNode类具有工具提示属性.如果不合适,您首先需要做我说的话,尝试找到一种将HTML/Javascipt注入TreeNode对象的方法.
The TreeNode class has a tooltip property. If that does not suit, you need to do what I said in the first place, try to find a way to inject your HTML/Javascipt into the TreeNode objects.


这篇关于通过javascript为treeview节点添加事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆