Event for "group" property change of node

Is there a way to trigger an event when the property “group” is changed that is when i pick one node from one group and drop it in another? Is there any other way then modelchangelistener?

Well, you could implement event handlers for Group.memberAdded and memberRemoved: Group | GoJS API

But note that when loading an existing model, the memberAdded event handlers will be called, so you will probably want to ignore those calls.

that works for what i needed there is another requirement to bind an event on a property that is not a functionality of go js e.g i have a node and there is a property DataType and i change it through the property inspector or programatically(through code). Is there a way to make custom event bindings?

I do not understand what your additional requirement is. Can’t you implement that “DataType” property using a getter and a setter where the setter notifies you?

for example i have a property primaryKey in node {
“figure”: “Rectangle”,
“nullable”: false,
“AI”: false,
“fill”: “#f2f2f2”,
“objectType”: 19,
“RelationshipId”: 5,
“DT_type”: “”,
“Unique”: false,
“text”: “pk1”,
“foreignKey”: false,
“primaryKey”: true,
“key”: -3,

  }

now from property inspector i change it to false
upon which i have to call a function that dose some other work on diagram like link creation etc.

right now i have done this with modelChangeListener
this.diagram.addModelChangedListener(
e => {
this.checkGroup(e);
this.checkPk(e);

      });

then i check e.propertyname then the new and old value and so on

Yes, a Model Changed listener is the most general mechanism for detecting such property changes. What’s wrong with that approach for your app?

nothing is wrong per-say i was just wondering is there another way which might be better. Thanx anyway.