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
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);

answered 03 May '12, 10:43

Dave's gravatar image

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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



Asked: 30 Apr '12, 16:04

Seen: 1,859 times

Last updated: 03 May '12, 10:43