I am trying the code below.
When I add the line: $datab4=$data; it prevents saving the update-probably a code error in do_onselect?
function do_onselect(id)
{
var rd = jQuery('#list1').jqGrid('getCell', id, 'company'); // where invdate is column name
jQuery("#span_extra").html(rd);
$datab4=$data;
}
then (to log only fields changed):
function update_log($data)
{
global $g,$THISTABLE,$resultbefore,$datab4; foreach($data[params] as $k=>$d)
{
//global $StringID;
//global $user;
//$achgs2=$achgs2."(`action`,`attribute_name`,`new_value`, `updated_by`) VALUES ('Update', '$k','$d', '$user')";
$db4=$data["params"]["$k"];
if ($db4<>$d and $k<>"LastUpdated" and $k<>"seqnum") {
$achgs2=$achgs2."[$k][$db4[$i]] to [$d]"; }
$i++;
}