MXgraph检查添加了哪些形状

时间:2018-10-01 16:04:59

标签: shapes mxgraph jgraph

我正在使用CELLS_ADDED事件检查图形中是否添加了形状。
如何获得形状标签?

我的代码是


Graph.prototype.addListener(mxEvent.CELLS_ADDED, function(sender, evt)
{
    var e = evt.getProperty('event'); // mouse event
    var cell = evt.getProperty('cell'); // cell may be null
    var tex = evt.getProperty('text');

    if (cell != null)
    {
        // Do something useful with cell and consume the event
        evt.consume();
    }
});

1 个答案:

答案 0 :(得分:0)

我不确定您要什么,但也许您想要的是这个

var label = cell.getValue();