0

I need to add a new property to a custom Edge shape (which extends mxConnector) to change color of the Edge, basing on that property value. Example is below:

function ExecutorEdge()
{
    mxConnector.call(this);
};
mxUtils.extend(ExecutorEdge, mxConnector);
ExecutorEdge.prototype.customProperties = [
    {name: 'trxSort', dispName: 'Transaction Sort', type: 'enum', defVal:'orig',
        enumList:[
            {val:'orig', dispName:'Original'},
            {val:'info', dispName:'Informational'},
            {val:'doc', dispName:'Documental'}
        ]}
];

mxCellRenderer.registerShape('executorEdge', ExecutorEdge);

I managed to do the same thing for custom shape which extends mxEllipse but with Edge the property doesn't even occur on properties table.

sys463
  • 337
  • 2
  • 5
  • 18

1 Answers1

0

My bad, I was setting my new shape to endArrow property not shape. Using the code in question description and creating Edge template as below works fine. New custom property is addedd successfully.

this.createEdgeTemplateEntry('shape=executorEdge;html=1;', 50, 50, '', 'Executor Link', null, tags)
sys463
  • 337
  • 2
  • 5
  • 18