3.2.0

Radio button in grid can't be selected

I am trying to put a radio button into a grid. The button appears but I can't select it manually or programmatically. The checkbox works fine with the same code.

Here is a very simple grid that demonstrates the problem:

var myData = [
["MSFT","Microsoft Corporation", "314,571.156", "32,187.000", "55000"],
["ORCL", "Oracle Corporation", "62,615.266", "9,519.000", "40650"],
["SAP", "SAP AG (ADR)", "40,986.328", "8,296.420", "28961"],
["CA", "Computer Associates Inter", "15,606.335", "3,164.000", "16000"],
["ERTS", "Electronic Arts Inc.", "14,490.895", "2,503.727", "4000"],
["SFTBF", "Softbank Corp. (ADR)", "14,485.840", ".000", "6865"],
["VRTS", "Veritas Software Corp.", "14,444.272", "1,578.658", "5647"],
];


var myHeaders = ["Ticker", "Company Name", "Market Cap.", "$ Sales", "Employees"];
var obj = new AW.UI.Grid;
obj.setId("myGrid");
obj.setCellText(myData);
obj.setHeaderText(myHeaders);
obj.setColumnCount(5);
obj.setRowCount(7);
obj.setSelectorVisible(false);
obj.setSelectionMode("none");
obj.setCellTemplate(new AW.Templates.Radio, 0);
for (var i=0;i<obj.getRowCount();i++)
{
obj.setCellValue(true,0,i);
}
document.write(obj);

Am I doing something wrong or is this a bug?
Jim V.
May 20,
The AW.Templates.Radio class was intended to work like 'CheckedItem' (i.e. linked to the selected items model) and not like a 'Checkbox' (linked to the item value property). You can create checkbox-like radio template this way -

var radio = new AW.Templates.Checkbox;
radio.setClass("toggle", "radio");
radio.setClass("templates", "radio");
obj.setCellTemplate(radio, 0);

Alex (ActiveWidgets)
May 23,

This topic is archived.

See also:


Back to support forum