I have two jqGrids ("in_table", and "out_table") that are identical except for their data. Thanks to help I received on this post, I now understand how to add a customizable button. When the button is pushed, I'd like to delete the row from the table and add it to the other.
The following code, which is called when the button is pushed, is unpredictable - it works for a while and then it stops working!
The console shows an error:
Uncaught TypeError: Cannot read property 'name' of undefined
Code:
function sign_in_out_action(myself,rowid,icol,cellcontent,e){
var this_row = myself.getRowData(rowid);
if( in_out_button_content(cellcontent)== "In"){
alert('Signing OUT');
this_row.in_out = "Out";
$('#out_table').jqGrid('addRowData',1,this_row);
myself.delRowData(rowid);
}
else{
if( in_out_button_content(cellcontent)== "Out"){
alert('Signing in');
this_row.in_out = "In";
$('#in_table').jqGrid('addRowData',1,this_row);
myself.delRowData(rowid);
}
else{
alert("what? "+in_out_button_content(cellcontent));
}
}
It would seem pretty straightforward to delete and add data. I would appreciate any insight into what I am doing wrong.