3.2.0

URGENT!! Check Box and Images problems

Hi guys,

I have some questions regarding checkboxes and images in the grid.

1. I have a check boxes in my grid each and every row in column 3.
my problem is when i click on check box only i want do some action.
if i click on the cell just i want to highlight the row.
(But now when i click on checkbox or in the cell my action is happends. i want to stop this action when i clicked on cell only)

2. In this same column i am displaying checkboxes and images,
based on some other column values i am selecting the checkbox and disabled. When i checked the checkbox and disabled i am not able get the colors of images its coming in black and white color what is the reason.

MyCheckbox = AW.Templates.Checkbox.subclass();
MyCheckbox.create = function() {
AW.Templates.Checkbox.create.call(this);
var abc = this.prototype;
abc.setContent("box/text", "");

abc.setClass("disabled", function() {
if (this.$1 != null) {
if (this.$owner.getCellText(15, this.$1) != "null") {
return "control";
}
}
return "";
});

abc.setEvent("onclick", function(event){
if (this.$1 != null) {
if (this.$owner.getCellText(15, this.$1) == "null") {
this.setControlProperty("value", "true");
this.setClass("disabled", "control");
acknowledge(this.$owner.getCellText(0, this.$1))
}
}
});

abc.refresh=function(){
try {
this.refreshClasses();
}
catch(err){
}
}
}

obj.setCellTemplate(new MyCheckbox,3);

3. I have some images as a links in column 13 (i.e. note icon)
When i clicked on image i want open one popup with some data, this is working fine i had done. But the problem is when i clicked on image that row is selecting i want to stop the selection of row when i clicked on images.
This is code which i am using.

var cell = new AW.Templates.Image;
var image = cell.getContent("box/image","");
image.setTag("a");
image.setAttribute("target", "_new");
image.setAttribute("href", "#");
image.setEvent("onclick", function(event){
openViewNote(this.$owner.getCellText(0,this.$1));
});

obj.setCellTemplate(cell,13);
obj.setCellImage("note",13);

4. I am getting extra column in the last in grid how to remove it.
Narayana Swamy, Bangalore
September 19,
1).

You should remove 'onclick' event handler from the template element and put it to checkbox (marker element) -

obj.setEvent("onclick", "")
obj.getContent("box/marker", function(event){
...
});

2).

aw-disabled-control style affects all elements of the control, including text and images. If this is not what you want - you should make your own style which affects only checkbox, see /source/styles/common/checkbox.css

3).

You should stop event bubbling/event propagation after you had processed the event


Alex (ActiveWidgets)
September 19,

This topic is archived.

See also:


Back to support forum