Mxgraph check which shape is added

248 Views Asked by At

I am using CELLS_ADDED event to check if shape added in the graph.
How can I get the label for the shape?

My code is


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

There are 1 best solutions below

0
On

I'm not sure what you asking for but maybe what you want is this:

var label = cell.getValue();