:: Forum >> Version 2 >>

Radio button in grid

I need to put a radio button in the grid and have only one value capable of being selected (i.e. if radio button is selected on row1 and then the radio button is selected on row2, then, the radio button is deselected on row1). Any ideas?
AWSWUser
Friday, April 14, 2006
Starting with checkbox selection -

http://www.activewidgets.com/grid.howto.selections/selecting-rows-with-checkboxes.html

var myController = {

        
onKeyUp:        "selectPreviousRow",
        
onKeyDown:        "selectNextRow",
        
onKeyHome:        "selectFirstRow",
        
onKeyEnd:        "selectLastRow",
        
onKeyCtrlHome:    "selectFirstRow",
        
onKeyCtrlEnd:    "selectLastRow",
        
onKeyPageUp:    "selectPageUpRow",
        
onKeyPageDown:    "selectPageDownRow",
        
onRowMouseDown:    "selectClickedRow",

        
onRowSelectedChanged: function(vi){this.getRowTemplate(i).refresh()}
};



    var 
obj = new AW.UI.Grid;

    
obj.setCellData(function(cr){return "." r});
    
obj.setHeaderText("header");
    
obj.setColumnCount(10);
    
obj.setRowCount(100);

    
obj.setController("selection"myController);
    
obj.setCurrentSelection("row");
    
obj.setCellTemplate(new AW.Templates.Radio0);

    
document.write(obj);

 
Alex (ActiveWidgets)
Monday, April 17, 2006



This topic is archived.

Back to support forum

Forum search