3.2.0

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
March 17,
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)
March 18,
thank you alex! it works great!
mango
March 18,

This topic is archived.

See also:


Back to support forum