【问题标题】:getOrgChart.js for a supply chaingetOrgChart.js 用于供应链
【发布时间】:2018-05-07 16:00:40
【问题描述】:

我正在尝试在网页中创建供应链

为此,我使用 getOrgChart 插件。问题是他们只允许我从父节点创建子节点,而对于我的问题,他们帮助我让我的客户成为我的供应商。

如您所见,我只能在一个 getorgchart 中显示我的供应商和公司,在另一个 getorgchart 中显示同一家公司及其客户。我的目标是在单个 getorgchart 中显示所有内容。 对不起,我的英语,我是西班牙人。 问候。

代码js。

 <div   id="people"></div>
 <div   id="people2"></div>
 <script type="text/javascript">
                  $(document).ready(function(){
                    $.getJSON("listaproCS.php",function(source){
                        
                      console.log(source);

                      var peopleElement = document.getElementById("people");
                      var orgChart = new getOrgChart(peopleElement, {
                         enableEdit: false,
                         enableDetailsView: false,
                         primaryFields: ["nombre"],
                         photoFields: ["imagen"],
                         orientation: getOrgChart.RO_RIGHT,
                         dataSource : source
                         });
                    });

                    $.getJSON("listaclieCS.php",function(data){
                      console.log(data);
                      var peopleElement = document.getElementById("people2");
                      var orgChart = new getOrgChart(peopleElement, {
                         enableEdit: false,
                         enableDetailsView: false,
                         primaryFields: ["nombre"],
                         photoFields: ["imagen"],
                         orientation: getOrgChart.RO_LEFT,
                         dataSource : data
                       });
                    });
                   });
 </script>

我通过 JSON 获得的数据,我在控制台中显示它们

enter image description here

【问题讨论】:

  • 在寻找解决方案时遇到非常具体的错误或问题会有所帮助。根据您的描述,别人可能更难确切地知道您需要什么。
  • 我明白了,很抱歉我的问题,但我看到使用 getOrgChart 的人并不多,我的问题就是这样。
  • 如果您分享您是如何实现显示父/子节点的,那么有人可能会看到您的实现存在问题。
  • 现在我编辑它,他们要显示的数据,我通过咨询我的 BD 得到它,在那里我有供应商、客户、公司表。我通过 JSON 获取它并在 javascript 中捕获它。

标签: javascript php jquery orgchart getorgchart


【解决方案1】:

当前版本不支持多父节点

【讨论】:

  • 用orgchart de jquery你觉得如果你能拥有它吗?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2014-04-13
  • 2017-04-14
  • 2014-03-20
  • 2016-09-02
  • 1970-01-01
  • 2012-07-09
  • 1970-01-01
相关资源
最近更新 更多