:: Forum >> Version 2 >>

Selector Checkbox

I have a selector column width checkbox each line and I want to select/unselect all width the checkbox in the topselector header, which function I have to assign?
fabius
Thursday, October 7, 2010
/javascript.forum.18468.5/show-checkbox-on-the-selector.html
C++
Thursday, October 7, 2010
var CellData = [
[
0,"99917180","Nokia 6303i classic matt black","9,99"],
[
0,"99916954","Nokia 6700 slide petrol MyCommunity","4,95"],
[
0,"99916954","Nokia 6700 slide petrol MyCommunity","4,95"],
[
0,"99916954","Nokia 6700 slide petrol MyCommunity","4,95"],
[
0,"99916954","Nokia 6700 slide petrol MyCommunity","4,95"],                                
[
0,"99916954","Nokia 6700 slide petrol MyCommunity","4,95"],                                
[
0,"99916954","Nokia 6700 slide petrol MyCommunity","4,95"],                                
[
0,"99916954","Nokia 6700 slide petrol MyCommunity","4,95"],                                
[
0,"99916954","Nokia 6700 slide petrol MyCommunity","4,95"],                                
[
0,"99916954","Nokia 6700 slide petrol MyCommunity","4,95"],                                                               
[
0,"99916954","Nokia 6700 slide petrol MyCommunity","4,95"],
[
0,"99916954","Nokia 6700 slide petrol MyCommunity","4,95"],
[
0,"99916954","Nokia 6700 slide petrol MyCommunity","4,95"],
[
0,"99916954","Nokia 6700 slide petrol MyCommunity","4,95"]
];

var 
myHeaders = ["Wahl","Artikelnummer","Beschreibung","Preis"];

    var 
obj = new AW.UI.Grid

obj.setId("myGrid");
obj.setCellText(function(c,r){return CellData[r][c]} );
obj.setHeaderText(myHeaders);
obj.setColumnCount(4);
obj.setRowCount(CellData.length);
    
obj.setColumnWidth(500);  
    
obj.setColumnWidth(1001);
    
obj.setColumnWidth(2902);
    
obj.setColumnWidth(503);
obj.setSelectionMode("none");
 
obj.setSelectorVisible(true);
obj.setSelectorWidth(24);


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


var 
CBToogle = new AW.UI.Checkbox;
obj.setTopText(CBToogle); 
CBToogle.onControlValueChanged  = function(value){
this.refresh();
 
MarkUnmarkAll(value);

    
obj.setCellValue(function(colrow){return CellData[row][0]==1 ? true false}, 0); 
obj.setCellText(function(colrow){return this.getCellValue(colrow"1" "0"}, 0);

    
obj.onCellClicked = function(valuecolrow){
    if(
col == 0) {
    var 
value
       
if (a) {
            
a=1;
            }else{
            
a=0;
            };
            for (
x=0;x<CellData.length;x=x+1)
            {
            if (
!= row) {
                
obj.setCellValue(false,0,x);  
                
//alert(x);        
                
}
            }
            
alert("SuplierAid:"+CellData[row][1]+ " Status:"+a);
            
//update_memdata(CellData[row][1], value);
            
};
     }
    
function 
MarkUnmarkAll(value) {
for (
x=0;x<CellData.length;x=x+1){
obj.setCellValue(value,0,x);

obj.getRowsTemplate().refresh();
C++
Thursday, October 7, 2010
thank you very much.
fabius
Thursday, October 7, 2010



This topic is archived.

Back to support forum

Forum search