:: Forum >> Version 2 >>

cannot select checkbox in selector

i am trying to put a checkbox on the row selector. the cells can be edited individually so we cannot use

obj.setSelectionMode("multi-row-marker");

my problem is that i can get the checkboxes to show, but when i click on them, they just remain un-checked.

here is my skeleton code:

// create ActiveWidgets Grid javascript object
var obj = new AW.Grid.Extended;

// set number of rows/columns
obj.setRowProperty("count", rCount);
obj.setColumnProperty("count", cCount);

obj.setCellText(thisData); // data set in a js array
obj.setHeaderText(myHeader); // header

obj.setCellEditable(true);

obj.setSelectorVisible(true);
obj.setSelectorWidth(30);
obj.setSelectorTemplate(new AW.Templates.CheckBox);

// write grid html to the page
document.write(obj);

what am i doing wrong? i think i am missing something? thanks!
mango
Monday, March 17, 2008
You need to 'refresh' a selector after click -

obj.onSelectorValueChanged = function(v, i){
this.getSelectorTemplate(i).refresh();
}

You can also try using CheckedItem template (which changes rowSelected instead of selectorValue) -

obj.setSelectorTemplate(new AW.Templates.CheckedItem);
obj.onRowSelectedChanged = function(v, i){
this.getSelectorTemplate(i).refresh();
}
Alex (ActiveWidgets)
Tuesday, March 18, 2008
thank you alex! it works great!
mango
Tuesday, March 18, 2008



This topic is archived.

Back to support forum

Forum search