Drag and drop of a cell to an unfolded group works fine. How can I drop a cell into a folded group ?

There's no highlight of the target, the dragged cells are just moved.

asked 14 Nov '12, 08:01

fletessi's gravatar image

fletessi
31
accept rate: 0%


Override mxGraph.isValidDropTarget, eg.

graph.isValidDropTarget = function(cell, cells, evt)
{
  if (this.isCellCollapsed(cell))
  {
    return true;
  }

  return mxGraph.prototype.isValidDropTarget.apply(this, arguments);
};
link

answered 15 Nov '12, 09:26

Gaudenz's gravatar image

Gaudenz
80.1k1310
accept rate: 39%

I have overriden the method with the following code and it works fine:

@Override
public boolean isValidDropTarget(Object target, Object[] cells) {
  if (target instanceof MyGroupVertex) {
    return true;
  }
  return super.isValidDropTarget(target, cells);
}

Now I would like to perform a check on cells type but cells array is always null.

link

answered 16 Nov '12, 04:17

fletessi's gravatar image

fletessi
31
accept rate: 0%

Works for me (ie cells array is never null).

(16 Nov '12, 07:41) Gaudenz
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:

×194
×37
×13
×8
×6

Asked: 14 Nov '12, 08:01

Seen: 1,702 times

Last updated: 16 Nov '12, 07:41