Auto Increment ID not showing after save


I have a grid which seems to be working fine when inserting, deleting, updating, BUT , when a new row is inserted and the grid updated, then the column ‘ID’ which is supposed to display the newly generated MySQL id for the table is still empty.

If I reload the grid then the ID is displayed properly.

I notice similar behavior with fields that have default values, after saving the grid the row is not repopulated with the values currently in the database.

In the following example, the column “isactive” has a default value of 0 , “durationdays” also default value 0 , nothing is shown in the grid after saving.

Finally , after the grid is saved , I check that there is only one request to the server, but the “onAfterUpdate” event is fired as many times as the rows that were updated. Is there any way to only fire the event once?

        mygrid = new dhtmlXGridObject('grShows');        
        mygrid.setHeader("ID,Description,Days Duration,Active,Registration Open,Registration Close");   //sets the headers of columns
        mygrid.setColumnIds("id,description,durationdays,isactive,registration_open,registration_close");         //sets the columns' ids
        mygrid.setInitWidths("50,250,100,100,200,*");   //sets the initial widths of columns
        mygrid.setColAlign("left,left,left,left,left,left");     //sets the alignment of columns
        mygrid.setColTypes("ro,ed,ed,ch,ed,ed");               //sets the types of columns
        mygrid.setColSorting("str,str,str,str,str,str");  //sets the sorting types of columns

        dpf = new dataProcessor("data/shows.php");

dpf.attachEvent("onAfterUpdate", function(sid, action, tid){
            if (action == "error")
                alert("There was an error:";

            } else {
                alert('Data saved!');


$mysqli = new mysqli('localhost', 'user', 'pass', 'mytestdb'); 


$gridConn = new GridConnector($mysqli,"MySQLi");