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
20
Updating igGrid with PHP
posted
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:
<?php
echo ("{Success: true}");
die();
?>
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.
Parents Reply Children
No Data