| Support Center

(Back to Website)

Support Center

Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

How do I get Data before updating

John N Oct 01, 2017 09:33AM PKT

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

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')";
if ($db4<>$d and $k<>"LastUpdated" and $k<>"seqnum") {
$achgs2=$achgs2."[$k][$db4[$i]] to [$d]"; }

Up 0 rated Down
Abu Ghufran Oct 02, 2017 12:25AM PKT PHP Grid - Support Center Engineer

I don't fully understand your query.
The code '$datab4=$data;' is php code which cannot be placed in JS code section of do_onselect(id).

Post Your Public Answer

Your name (required)
Your email address (required)
Answer (required)

Contact Us

  • Post a Public Question
  • Email Us
  • Live Chat!
  • Ask the Community


    • Paste complete code that is involved in your question. You can use pastebin.com to share code link.

    Screenshots or Online link of webpage is helpful in resolution. You can also send email at address mentioned below.

    • To report an issue, Write steps to regenerate the case.

    • For email support or live chat, Use gridphp@gmail.com and add it in Google Chat.
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
Invalid characters found