Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
Updating igGrid with PHP
My application is developed in PHP and I'm trying to implement the igGrid within it. I have a PHP file which displays an igGrid with data generated from some PHP Mysqli functions. I want to do the database updating in another PHP file, and so I set the updateUrl to point to it. After making changes in the grid, the updateUrl is called, and the database is updated just fine, but the grid thinks the update was a failure. Consequently, the transaction log grows cumulatively after each cell update, and the database update statements end up being executed many more times than necessary.

In the grid.php file I have the igGrid setup like... (Complete file grid.php is attached)
     dataSource: data,
     dataSourceType: "json",
     responseDataKey: "results",
     autoCommit: true,
     updateUrl: "truckscaletransupdate.php",
I understand that the updateUrl file must respond to the grid with a success or failure message. I have simplified the file so now it only contains the following:
echo ("{Success: true}");
However, the iggrid seems not to interpret the success message. I have a function 
saveChangesErrorHandler : function (jqXHR, textStatus, errorThrown) {
     alert(errorThrown + " : " + textStatus );
Anytime I change data in the grid, the saveChangesErrorHandler always returns the following:
Saving changes was not successful. Server did not return Success object or returned Success:false. : success
I am new to Javascript so may be missing something simple. I have tried many variations of returning success but no luck.
No Data
  • 23868
    Verified Answer
    Offline posted

    Hello Ryan,


    The response data is Ok, but most probably the response is treated as "plain/text" content type. Try to set "Content-Type: application/json; charset=utf-8" response header.


    Best regards,

    Martin Pavlov
    Infragistics, Inc.