【问题标题】:Creating vertices in multiple mxWindows在多个 mxWindows 中创建顶点
【发布时间】:2020-08-01 16:04:53
【问题描述】:

我想在 mxGraph javascript 库中创建多个 mxWindows。 我创建的所有顶点似乎都出现在我创建的最后一个 mxWindow 中,即使我在创建第二个 mxWindow 之前创建了顶点。

我应该使用哪个父母?系统不接受 mxWindow 对象作为父对象。 使用 graph.getDefaultParent 没有帮助,因为它似乎总是返回与最近的 mxWindow 关联的同一个父级。

如何为每个 mxWindow 指定单独的父级?

任何示例代码在一个 mxWindow 中创建一个顶点并在另一个 mxWindow 中创建另一个顶点?

谢谢

【问题讨论】:

    标签: mxgraph


    【解决方案1】:

    好像我需要创建第二个顶部元素

    <div id="graphContainer1"
      style "overflow:auto;position:abolute;width:100%;height:100%;..."
    </div>
    
    <div id="graphContainer2"
      style "overflow:auto;position:abolute;width:100%;height:100%;..."
    </div>
    

    并为每个容器创建一个单独的图形对象。

    container2 = document.getElementById('graphContainer2');
    graph2 = new mxGraph(container2);
    ..
    window2 = new mxWindow('second window', container2, x, y, w, h, true, true);
    ..
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-04-14
      • 1970-01-01
      • 2016-05-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多