3.2.0

Template

Hi, I'm trying to make a template to use in my tree. It's going to be a checkbox with 3 different states (On, Off and Null), allready have the necesary css-classes available, since we already use it, and are now trying to get it in to the tree. Tried to copy the checkbox-template, and edit it, but with no luck. Anybody got any tips/suggestions?
Tom
May 23,
Is this what you are looking for? -

http://www.activewidgets.com/javascript.forum.17937.3/can-a-checkbox-be-included.html
Alex (ActiveWidgets)
May 23,
Not completely, we really need a checkbox that can change between 3 states, being on, off and null (including this, excluding this, and one that is not included). I already got the checkbox in the tree, but it only really seems to have two different states, checked and unchecked.
Tom
May 23,
The checkbox also has the third value - 'mixed', i.e.

checkbox.setControlValue("mixed");

The appearance of each state is controlled by .aw-value-true, .aw-value-false and .aw-value-mixed classes, which change the background image on the box/marker element (.aw-item-marker class).
Alex (ActiveWidgets)
May 23,
The .aw-value-... class is implemented this way -

obj.setClass("value", function(){return this.getControlProperty("value") || false});

which makes the null value appear the same as false.
Alex (ActiveWidgets)
May 23,
I guess you should modify the template removing ... || false part -

obj.setClass("value", function(){return this.getControlProperty("value")});

and possibly modifying the background image for the 'null' value.
Alex (ActiveWidgets)
May 23,
got it to work by changing the object.setevent, the || false didn't really seem to matter.

obj.setEvent("onclick", function(){
var value = this.getControlProperty("value");
switch(value){
case "mixed": value=true; break;
case false: value="mixed"; break;
case true: value=false; break;
default: value=true; break;
};
this.setControlProperty("value", value);
});

is the new one.
Now just one more problem - is there a way to combine the checkbox with an onclick-event?
Tom
May 23,
Just read
http://www.activewidgets.com/javascript.forum.18719.2/how-do-i-create-treeview.html

So it seems to be a known issue - found a way around by now, or is a fix on it's way?
Tom
May 23,

This topic is archived.

See also:


Back to support forum