I have defined a column of a subgrid to display Save button as follows :
{field:'action',title:'Save',width:40,align:'center',
formatter:function(value,row,index){
if(row.editing) {
return '<a href="javascript:void(0)" onclick="saverow()"><img src="images/cross.jpg" /></a> ';
}
else {
return '<a href="javascript:void(0)" onclick=""><img src="images/checkmark.png" /></a> ';
}
}
Now I want to save the current selected row by calling saverow() function under onClick event, where the problem is I have to pass the current row as parameter to the saverow() function so that I can call a PHP file to save the data in table, but I am unable to send the current row as parameter to the saverow() function. Any body please help me.
Calling of PHP file in saverow() function what I required is as follows:
$.get("rating.skUpdate.php?yr="+yr+"&tno="+row.tno+"&skname="+encodeURIComponent(row.skname)+"&mra="+row.mrating_ass+"&trgdate="+row.trgdate+"&remarks="+encodeURIComponent(row.remarks)+"&final=Y");
It requires the current row data which is not available in saverow() function. If I call like as onClick = "saverow(row)", it does not work.