我想用.setName(chk_id)获取复选框的输入值(真/假),当id是我在flexTable单元格中引入的行的id时。但我总是得到 "e.parameter_"undefined"" 因为 e.parameter.chk_i 是"undefined"
var flexTableReg = app.createFlexTable().setId("flexTableReg").setBorderWidth(1);
var check = new Array(lastRow);
for(var r = 0; r < lastRow; r++){
for(var c = 0; c < lastCol; c++){
var text = rowsToConfirm[r][c].toString();//HERE IS THE CELL
flexTableReg.setText(r+1, c, text);
}
var id = rowsToConfirm[r][0];
check[r] = app.createCheckBox().setName("chk_"+id).setId("chk_"+id);
flexTableReg.setWidget(r+1, lastCol, check[r]);
}//end fors
}//end if
var botMod = app.createButton().setText("Activar").setId("botStatus");
var botHandle = app.createServerHandler("changeStatus").addCallbackElement(verticalPanelAdmin);
botMod.addClickHandler(botHandle);
mainPanelAdmin.add(flexTableReg);
mainPanelAdmin.add(botMod);
verticalPanelAdmin.add(mainPanelAdmin);
absolutePanelAdmin.add(verticalPanelAdmin);
app.add(absolutePanelAdmin);
return app;
}
function changeStatus(e){
var ss = SpreadsheetApp.openById(LOGS_SHEET_ID);
var app = UiApp.getActiveApplication();
var datarray = getDataArray();
var lastRow = ss.getLastRow();
for(var i =0; i<=lastRow;i++ ){
try{
var par = e.parameter["chk_"+i];
if(true){
stop_if_true
var row = getRowByID(0,lastRow,i);
ss.getRange("E"+i).setValue("1");
}//end if
}catch(e){e.parameter_"undefined" //if e.parameter "undefined"
return app;}
}//end for
return app;
};