Binding does not update on null value

Hi,

I have a diagram in which nodes that are grouped may not be grouped again, therefore i use a binding:

new go.Binding('groupable', 'group', function(v) { return !v; })

It works when i group an object, but not when i ungroup it. I think it has to do with the fact that the group value is set to null. Because if i manually set it to an empty string (in a transaction) it does work. Is there a way to let the go.Binding also update on null values?

I also have another question, how do i best set the skipsUndo/redo for grouping and ungrouping events?

Thanks,
Tim

1: Bindings do get evaluated when data.group === null, but not when the value is undefined.

Maybe you want to use http://gojs.net/latest/api/symbols/Part.html#containingGroupChanged instead of a Binding to “group”.

2: Override http://gojs.net/latest/api/symbols/CommandHandler.html#groupSelection and http://gojs.net/latest/api/symbols/CommandHandler.html#ungroupSelection to temporarily set http://gojs.net/latest/api/symbols/Diagram.html#skipsUndoManager.

http://gojs.net/latest/intro/extensions.html

yes, awesome, thats what i needed :smile:

thanks