简体   繁体   English

创建一个树形结构

[英]Create a tree structure

I am working on an asp .net project. 我正在一个asp .net项目。 In my aspx page i have a gridview which has 3 columns("element","Target","Parent"). 在我的aspx页面中,我有一个gridview,其中有3列(“ element”,“ Target”,“ Parent”)。 On the client side i want to build a tree structure using the data in the gridview and then build a tree with figures. 在客户端,我想使用gridview中的数据构建树结构,然后使用数字构建树。 I found information and modules about how to build the figure but i want some advice on how to make the structure. 我找到了有关如何构建图形的信息和模块,但我希望获得有关如何构建结构的一些建议。 Are there any ready javascript algorithms to do this?. 是否有任何可用的JavaScript算法可以执行此操作? Thx in advance 提前Thx

Use a CSS tree, such as the following: 使用CSS树,例如:

Use the :checked pseudo class to style checkboxes as presentational elements to emulate state, such as: 使用:checked伪类来设置复选框的样式,以作为表示性元素来模拟状态,例如:

 .folder input[type='checkbox']:checked { display: block; }
 .folder input[type='checkbox'] { display: inline; }

Combine that with <label> elements as proxies to hide/show on demand, and nested <blockquote> elements as hierarchy. 结合使用<label>元素作为代理以按需隐藏/显示,并嵌套<blockquote>元素作为层次结构。

References 参考

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM