3.2.0

Disabling a checkbox template

Hi,

I am placing a AW.Templates.Checkbox inside of a header template on the 0th column and I am wondering how to make it appear disabled?

I can do:

var test =  new AW.Templates.Checkbox;
test.setAttribute("disabled", "disabled");


This will disable the checkbox fine but I want it to show up greyed out and unclickable to the user. I saw in another post that you can do this:

var disabled = new AW.Grid.Header;
disabled.onMouseOver = null;
disabled.onMouseOut = null;
obj.setHeaderTemplate(disabled,0);



So I attempted this:

var test =  new AW.Templates.Checkbox;
test.setAttribute("disabled", "disabled");
test.onMouseOver = null;
test.onMouseOut = null;


If there is no way to get it to show up greyed out. How do I go about setting the onclick event to null?

I tried

test.onClick = null;
test.onMouseClick = null;
test.onclick = null;


and none of them work. While it doesn't do anything when the user clicks on the checkbox in it's current state. It would be nice if when the user clicked on it, nothing appeared to happen.

Any help would be appreciated.
jLH
March 12,
For headers it's easier using normal controls instead of templates, so
I would suggest to use AW.UI.Checkbox and setControlDisabled()


March 12,
The only problem with doing it this way is that the checkbox doesn't appear correctly in the header template and I get this ugly styling issue.
jLH
March 12,
After reading some more on the forums I found that this line will change the color of the box.

obj.getHeaderTemplate(0).getContent("box").setStyle("background", "#aca899");



Now I would just have to change the image of the checkbox that is shown. I noticed that all the checkboxes are displayed on a .png and then I'm assuming there's code to only show a specific portion of that image. Is there anyway to change the image shown?

Any help would be appreciated.
jLH
March 24,
I suspect you'd just want to call setControlImage(). This link gives you all the details -
http://www.activewidgets.com/aw.system.control/control-image.html

Also have a look at the overview -
http://www.activewidgets.com/grid.howto.cells/images.html

You can also create your own.
Anthony
March 25,
I don't believe this operation can be performed on a template, however. :(
jLH
March 25,
Alex,

Is there going to be future support for a method that you can call on the checkbox template to disable it?
jLH
March 25,

This topic is archived.

See also:


Back to support forum