I am trying to create and call a checkbox from another function. formatStudentColumn adds a checkbox to every row in the table.
After that I want to trigger markChecked function and work with the rowIndex variable but at this point its throwing:
ReferenceError: 00123 is not defined
Here 00123 is the actual value of 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 +'" />';
}
123instead of00123?