Author Topic: Unable to get changes  (Read 1652 times)

wmangus

  • Newbie
  • *
  • Posts: 3
    • View Profile
Unable to get changes
« on: November 30, 2016, 12:40:22 am »
I am trying to get the changes to grid data.
The code is below:

    $("div#gridlocal").pqGrid({
      width: 750, height: 600,
      dataModel: dataModel1,
      colModel: colsOption,
      bottomVisible: false,
      track: true,
      recIndx: "taxnum",
      title: "Local Taxes"
   });
   
   $("input.Save").on("click", function() {
      var changes = {changes: $("div#gridlocal").pqGrid( "getChanges", {format: 'byVal'} )};
//      var changes = $(".gridlocal").pqGrid( "getChanges", {format: 'byVal'} );
      alert (changes);
      var urlvar = 'php/data_local.php?action=save';
      $.post(urlvar,changes,showMsg);
      function showMsg(data) {
         alert(data);
      }
   });

The php simply returns what was sent in changes, but shows an empty array.
Can you help?