In mxEditor you can set the attribute swimlaneRequired, to check that new cells only be inserted into an existing swimlane.

What is the criteria used by the editor to check if a cell is a swimlane, could I overload this criteria ??

asked 30 Apr '12, 16:04

Juan%20David's gravatar image

Juan David
1015
accept rate: 0%


The mxEditor uses graph.isSwimlane(vertex) to check if a cell is a swimlane. This method checks the cell to make sure the parent is not the root and the cell is not an edge, and then returns true if the cell's current style (obtained from the cell's state) has a value for mxConstants.STYLE_SHAPE set to mxConstants.SHAPE_SWIMLANE. You can override this method globally by overriding the mxGraph.prototype.isSwimlane definition, or you can do it for your specific instance of an editor like this:

editor.graph.isSwimlane = function (cell)
{
    // do some checking here and return true/false

    // the original method can also be called like this:
    return mxGraph.prototype.isSwimlane.apply(this, arguments);
};
link

answered 03 May '12, 10:43

Dave's gravatar image

Dave
244
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×228
×25
×10

Asked: 30 Apr '12, 16:04

Seen: 1,859 times

Last updated: 03 May '12, 10:43