Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - wmangus

Pages: [1]
1
Help for ParamQuery Grid (free version) / 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?

2
Thank you for your help. Your solution worked. :)
I tried to use ui.colIndx because it is listed in the documentation of the cellSave event.

3
I need to use the value in a cell to change values in other cells, but when I try to use ui.colIndx, it shows only "undefined".
The code is below:

   $("div#grid3").pqGrid({
      width: 375, height: 275,
      dataModel: dataModel3,
      colModel: colsOption2,
      bottomVisible: false,
      title: "New Single",
      cellSave: function ( event, ui) {
         alert( ui.colIndx);
      }

What am I doing wrong?


Pages: [1]