I know that you can use go.GraphObject.make to create a ‘CheckBox’ and usually people do ‘_doClick’ call to execute some code. But if there is a way of getting the status of the current check box so that _doClick can do different logics?
So my problem is how to determine the current state of the checkbox as the if logic in the code. Is that possible that ‘_doClick’ could be changed to ‘checked’ and ‘unchecked’ so that makes the developers more easier?
Just look at the value of, in your case, data.check1. The first argument to the “CheckBox” constructor is the data property name that it’s bound to. For example, if all I add to my node template is:
Hi Walter,
I have an editable slider using the Graduated Panel and a Checkbox.
I want to use the value of chekbox to toggle the slider’s edit mode.
"_doClick": function(e, obj) {
// obj.part.movable = !obj.part.movable; // To make the element movable. This works.
// Here I'm trying to toggle the editable data.
obj.part.data.editable = !obj.part.data.editable;
}
How does it work with doClick ?
Should I use go.Binding instead ?