Treegrid with Popup and attached form

Hi, I’m using treegrid v.2.6 with popup and form and I’m wanting to populate and save a form attached to a cell popup based on rowId.

Below code works for attaching the form to a popup based on double clicking on a particular cell.
However, I cannot get the form to interact with the datastore/dataprocessor to load/save data in the popup form.

I’ve got all of the required includes:

and data.php is:

require_once('config.php');	
require_once('connector/form_connector.php');

// sleep(1);
$form = new FormConnector($conn, “MySQL”);
//$form->enable_log(“log.txt”,true);
$form->render_table(“freight_split”,“id”,“id,totals,notes”);

client side:

		var total = new dhtmlXDataStore({
			url:"codebase/php/data.php"
			});
			total.data.scheme({
				totals:"",
				notes:""
			});
		var dp = new dataProcessor("codebase/php/data.php"); 
				dp.init(total); 

var loc_pop = new dhtmlXPopup();
var loc_Form = loc_pop.attachForm([
{type: “settings”,position: “label-left”,labelWidth: 75,inputWidth: 75},
{type: “input”, label: “Total”,name: “totals”,value: “”},
{type: “input”, label: “Notes”, name: “notes”, value: “”, rows: 5, style: “width:180px;”},
{type: “button”,value: “Ok”, name: “save_loc”}
]);
loc_Form.attachEvent(“onButtonClick”, function() {
loc_Form.save();
loc_pop.hide();
});
grid.attachEvent(“onRowDblClicked”, function(rowId,cellId){
var pop_level = grid.getLevel(grid.getSelectedId());
var w = grid.cellById(rowId,cellId).cell.offsetWidth;
var h = grid.cellById(rowId,cellId).cell.offsetHeight;
var x = getOffset(grid.cellById(rowId,cellId).cell).left;
var y = getOffset(grid.cellById(rowId,cellId).cell).top;
if (pop_level == 2 && cellId == 10) {
loc_pop.show(x,y,w,h);
loc_Form.bind(outturn);
var loc_dp = new dataProcessor(“codebase/php/data.php”);
loc_dp.init(loc_Form);
loc_Form.load(“codebase/php/data.php?id=”+rowId); }
});

Hi, I figured it out. I had to move the following code outside of my attachEvent

loc_Form.bind(outturn);
var loc_dp = new dataProcessor(“codebase/php/data.php”);
loc_dp.init(loc_Form);

Cheers,
Brian