如何将节点添加到asp TreeView [英] How to add nodes to asp TreeView
本文介绍了如何将节点添加到asp TreeView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好
我想通过Javascript向asp TreeView添加节点。任何人都可以给我一个例子
Hi guys
I want to add nodes to asp TreeView by Javascript. Can any one give me an example
推荐答案
从JavaScript的角度来看,没有TreeView
这样的东西。你只需要将一些元素添加到另一个DOM元素,也许是一个文本节点,并设置它的一些属性。
所以,你所需要的只是减少到以下功能:
https://developer.mozilla.org / en-US / docs / Web / API / Document / createTextNode [ ^ ],
https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement [ ^ ],
https://developer.mozilla.org/en-US/docs/Web/API/Node/appendChild [ ^ ],
https://developer.mozilla.org/en-US/docs/Web/API/Element/setAttribute [ ^ ]。
我希望我没有错过任何东西;这就是你所需要的一切。
-SA
From the JavaScript standpoint, there is no such thing asTreeView
. You just need to add some element to another DOM element, and perhaps a text node, and set some of its attributes.
So, all you needs are reduced to the following functions:
https://developer.mozilla.org/en-US/docs/Web/API/Document/createTextNode[^],
https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement[^],
https://developer.mozilla.org/en-US/docs/Web/API/Node/appendChild[^],
https://developer.mozilla.org/en-US/docs/Web/API/Element/setAttribute[^].
I hope I did not miss anything; this is really all you need.
—SA
这篇关于如何将节点添加到asp TreeView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文