单击任何节点时如何在ASP树视图中触发客户端事件 [英] How to Trigger Client Side Event in ASP Tree View when any node is clicked

查看:138
本文介绍了单击任何节点时如何在ASP树视图中触发客户端事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在从服务器端动态构造树视图节点.

我只想为两种类型的节点触发客户端事件
-子节点
-没有子节点的父节点
我需要禁用单击具有子级的父节点.

尽快获得您的建议/帮助

在此先感谢

Hi,

I am constructing a tree view nodes dynamically from server side.

I want to trigger a client side event for only two types of nodes
- Child node
- Parent node that has no child
I need to disable clicking the parent node that has child.

Expecting your suggestions/help asap

Thanks in advance

推荐答案

我只想为两种类型的节点触发客户端事件
-子节点
-没有子节点的父节点

这仅表示您要为所有没有子节点的节点触发一个事件.

遍历所有节点,看它们是否有子节点.如果没有,请附加事件.你尝试了吗?
或者,您可以将click事件附加到所有节点,并仅禁用具有某些子节点的那些节点.

尝试!
I want to trigger a client side event for only two types of nodes
- Child node
- Parent node that has no child

This simply means that you want to trigger an event for all the nodes that has no child.

Loop through all the nodes, see if they have a child. If not, attach the event. Did you try?
Alternatively, you can attach click event to all the nodes and disable only those nodes that has some child.

Try!


我找到了使用jquery调用客户端事件的解决方案

I found the solution to invoke client side event using jquery


(文档).ready(函数(){
(document).ready(function() {


这篇关于单击任何节点时如何在ASP树视图中触发客户端事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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