Hi,
the problem is the comparison line
if(id && id!==lastsel){
jQuery('#rowed3').jqGrid('restoreRow',lastsel);
jQuery('#rowed3').jqGrid('editRow',id,true);
lastsel=id;
}
that only works if lastsel has been changed- you need to have either an else option or remove the lastsel check alltogether if you need it for each click anyway.