简体   繁体   English

如何在 OrgChart 中折叠唯一的孩子?

[英]How to collapse only children in OrgChart?

I found this awesome library for creating organizational charts called OrgChart .我发现了一个很棒的库,用于创建名为OrgChart 的组织结构图。

Here it is what it looks like:这是它的样子: 在此处输入图片说明

The green arrows allow you to collapse the parents/children/siblings nodes.绿色箭头允许您折叠父/子/兄弟节点。 You can try it here to see what I mean: example你可以在这里试试看我的意思: example

My goal is to remove all the green arrows except the children ones so that I can collapse only vertically starting from the very top of the organization.我的目标是移除除儿童箭头之外的所有绿色箭头,以便我只能从组织的最顶部开始垂直折叠。 Do you have any idea how I can reach such result please?你知道我怎么能达到这样的结果吗?

Thanks in advance.提前致谢。

I found the solution to my problem:我找到了解决我的问题的方法:

In the file jquery.orgchart.js you need to remove from all the tags the following items:在文件jquery.orgchart.js 中,您需要从所有标签中删除以下项目:

  • class="edge horizontalEdge rightEdge oci"
  • class="edge horizontalEdge leftEdge oci"
  • class="edge verticalEdge topEdge oci"

So that you are only left with <i class="edge verticalEdge bottomEdge oci"></i> and all the other tags are <i></i>这样你就只剩下<i class="edge verticalEdge bottomEdge oci"></i>而所有其他标签都是<i></i>

在此处输入图片说明

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

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