I want to restrict move permission of a node by click of a btn and grant the permission back by the next click.
I am trying some logic as follows:
go.Node,
“Auto”,
{
movable: returnTrueFalse,
},
var _flag = 1;
var returnTrueFalse = function () {
var value;
if (_flag === 1) {
value = “true”;
_flag = 0;
console.log(_flag + " " + value);
} else {
value = “false”;
_flag = 1;
console.log(_flag + " " + value);
}
return value;
};
this is not showing error but the is also setting the value for movable false.
is there any other way of toggling movable true false?