Cannot add records to database from grid

We are struggling to finish a proof of concept using dhtmlx. We have an input screen that consists of a form (for order header data) and a container in the form that holds a grid (for order detail data). The form data should be saved in one table and the grid rows should be saved in another table when the user clicks the submit button. Currently, the form does save, but the grid does not. We have run it with the dataprocessor_debug on and using Firebug. I have included the error messages below.

We must be missing something; however, we cannot find where the problem is. Please review and let us know what direction we need to proceed to make this work.

This is the last piece of the puzzle and we can present this proof of concept for acceptance. After that, we can then order the Pro version to add the extra features. Thank you.

The functional sections of code in our html file are:

[b] var mydpform = new dataProcessor(‘php/bl_addDetail.php’);
mydpform.init(blForm);

		var mydpgrid = new dataProcessor('php/bl_gridDetail.php');
		mydpgrid.setTransactionMode("POST",true);
		mydpgrid.setUpdateMode("off");
		mydpgrid.enableDataNames(true);
		mydpgrid.init(mygrid);;[/b]

AND:

[b] var submitButton = new dhtmlXForm(“footer”,formDatafooter);
submitButton.attachEvent(“onButtonClick”,function(id){
if(id==“submit_bttn”){
blForm.resetDataProcessor(“insert”);
blForm.save();

			for (var rowId=1; rowId<mygrid.getRowsNum(); rowId++){
					mydpgrid.setUpdated(id,true);
					mydpgrid.sendData(id);
		}[/b]

The php file for the grid add is:

[b]<?php
require_once("…/…/…/dhtmlxSuite/dhtmlxConnector/php/codebase/grid_connector.php");
$conn = mysql_connect(“localhost”,“root”,"");
mysql_select_db(“billoflading”); // Database name

	$gridConn = new GridConnector($conn);
	
	$gridConn->render_table("blproddetail","id","BL_num,Qty,Item,Lot_num,Unit,Haz,ProductDescription,Weight");

?>[/b]

And when we run the code, we receive the following errors:

In the dhtmlxDataprocessor_debug:
Log:
row 1395166073484 marked [inserted,valid]
row 1395166073480 marked [updated,valid]
row 1395166073480 marked [updated,valid]
row 1395166073480 marked [updated,valid]
row 1395166073480 marked [updated,valid]
row 1395166073480 marked [updated,valid]
row 1395166073480 marked [updated,valid]
row 1395166073481 marked [updated,valid]
row 1395166073481 marked [updated,valid]
row 1395166073481 marked [updated,valid]
row 1395166073481 marked [updated,valid]
row 1395166073481 marked [updated,valid]
row 1395166073481 marked [updated,valid]
row 1395166073484 marked [insert,valid]
Initiating data sending for all rows
Sending all data at once
Server url: php/bl_addDetail.php?editing=true parameters
row submit_bttn marked [updated,valid]
Initiating data sending for submit_bttn
Error! row with such ID not exists submit_bttn
Initiating data sending for all rows
Server response received details
Action: insert SID:1395166073484 TID:10093
row 1395166073484 unmarked [updated,valid]

And the error message from Firebug:

[b]TypeError: d is null

…keys[g].indexOf("__")!=0&&(c[f.keys[g]]=f.values[g]);if(f=this.obj.UserData.grid…
dhtmlxgrid.js (line 171)[/b]

Thank you for your help.

Please, make sure that the ids of your rows are “1,2,3,4,5,…”
Please, refer to the classic ways of rows iterating:
docs.dhtmlx.com/doku.php?id=dhtm … ating_rows