ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: bsolteam on June 26, 2014, 07:02:10 pm

Title: Passing data from querygrid to backend with based on checkbox
Post by: bsolteam on June 26, 2014, 07:02:10 pm
Hi Param Query team,

I was trying to pass data from querygrid to backend i.e. remote location.
The issue is that I have a checkbox column in my grid, If i do not click on any checkbox at that time I am able to pass the data to remote location i.e. server side component.
But if I click on any checkbox and then try to pass the data from the grid, at that time it is not passing the data to server side component.

It shows the status as parser error and the error syntax is Unexpected Token <
in the alert box.


Here it is the code snippet i.e. the ajax call to pass the data from querygrid to server side..

function acceptChanges() {
      alert("hi");
      var DM = $("#grid_json").pqGrid("option", "dataModel");
      var data = DM.data;
      /*  $.each(data, function(key, item) {
            alert("test..."+item);

          }); */

      $.ajax({

         dataType : "json",
         //url: "/pro/products.php", //for PHP
         contentType : "application/json; charset=utf-8", //for ASP.NET
         type : "POST",
         async : true,

         url : "getJsonValue",  //for ASP.NET
         data : JSON.stringify(data), //for ASP.NET
         //data: { "updateList": JSON.stringify(updateList) },//for PHP
         mimeType : 'application/json',
         success : function(rows) {
            //debugger;
            alert("test...");
            $("#grid_json").pqGrid("commit", {
               type : 'update',
               rows : rows
            });
         },
         error : function(data, status, er) {
            alert("error 565: "  + " status: "
                  + status + " er:" + er);

         },
         complete : function() {
            alert("test 2...");
            $("#grid_json").pqGrid("hideLoading");
            $("#grid_json").pqGrid("rollback", {
               type : 'update'
            });
         }
      });


Please provide me any solution to overcome from this issue.
Title: Re: Passing data from querygrid to backend with based on checkbox
Post by: paramvir on June 27, 2014, 08:35:45 am
you have encountered a server error (more likely) or your response is not in valid JSON format.

Follow these steps to dig deeper:

put a breakpoint and debug your server side script

or

open your browser developer tools and check the request & response from server under network tab.

or

Check the server logs for errors.

or

or use try catch in the server script and return error as response in valid JSON format.