Gojs drop with kanban

Hi,
I’m working with the kanban example,
and I need to read the droppable element (key,text…)

mouseDrop:function(e,grp){

var ok=grp.addMembers(grp.diagram.selection,true);
How can I read the key of the droppable element?
Thanks in advance.

If you are talking about within the mouseDrop function, grp.diagram.selection will contain the set of copied parts that had been dropped. You can iterate over the set and look at the data.

grp.diagram.selection.each(function(p) {
  var data = p.data; // p is a Part, could be a node or link
  ...
});

OK now it’s correct,
Now I want to read the key of the target lane.

Thanks in advance

You can look at the properties on the object that is the value of Node.data. One of those properties is the key.

OK now it’s correct,
Now I want to read the key of the target lane.

Thanks in advance.

Ah, sorry, I misread your question.

If p is a Part, then p.containingGroup will tell you the Group, a.k.a. “lane”, that the part is in.

Remember that the value may be null if the part isn’t a member of a group.

OK now it’s correct,

Thanks a lot.

Hi,
Another question:
Is it possible to have the event of double click (or right click) on a rectangle ?
Like this I can open a window and see the data of my rectangle.
Thanks in advance.

Yes, set the GraphObject.doubleClick or contextClick event handler.
https://gojs.net/latest/intro/events.html#InputEvents

Ok it runs,
Thank you very much