:: Forum >>
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
Wednesday, May 23, 2007
Alex (ActiveWidgets)
Wednesday, May 23, 2007
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
Wednesday, May 23, 2007
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)
Wednesday, May 23, 2007
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)
Wednesday, May 23, 2007
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)
Wednesday, May 23, 2007
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
Wednesday, May 23, 2007
Tom
Wednesday, May 23, 2007
This topic is archived.
Back to support forum
Forum search