別の関数からチェックボックスを作成して呼び出そうとしています。formatStudentColumn
テーブルのすべての行にチェックボックスを追加します。
その後、markChecked
関数をトリガーしてrowIndex変数を操作したいのですが、この時点でスローします:
ReferenceError: 00123 is not defined
ここで00123は、rowIndex の実際の値です。
function markChecked(rowIndex){
console.log("rowIndex: " + rowIndex);
if(document.getElementById("student" + rowIndex ).checked)
{
//do something if its checked
}
else{
// do something if its unchecked
}
}
var formatStudentColumn = function(id){
rowIndex = this.grid.getItem(id).studentId;
return '<input type="checkbox" onClick="javascript:markChecked('+ rowIndex +')" id="student'+ rowIndex +'" />';
}