onAfterUpdate does not fire

Hi,

I might be missing something here, so hopefully it’s something simple that someone can spot that I’m missing.

I’m trying to save data from a popup window (just like the popup from the Contact Manager sample).

				studentsToolbar.attachEvent("onClick",function(id){
					if(id=="addStudent"){
						//open popup window
						var popupWindow = layout.dhxWins.createWindow("newStudent_win", 0, 0, 400, 400);
						popupWindow.center();
						popupWindow.setText("New Student");
						
						//add form
						var addStudentForm = popupWindow.attachForm();
						addStudentForm.loadStruct("xml/addStudentForm.xml");
						
						//data
						var dpfs = new dataProcessor("php/student_details.php");
						dpfs.init(addStudentForm);
						
						dpfs.attachEvent("onAfterUpdate", function(sid,action,tid,xml_node) {
							alert(action);
							//if(action=="inserted"){
							//	alert("inserted!");
							//	dpg.ignore(function() {
							//		studentsGrid.addRow(tid, [addStudentForm.getItemValue("firstName"),addStudentForm.getItemValue("lastName")], 0);
							//		alert("ignore!");
							//	})
							//}
							//studentsGrid.selectRowById(tid,false,false,true);
							//popupWindow.close();
						})
						
						addStudentForm.attachEvent("onButtonClick", function(name, command){
							dpfs.sendData();
							alert("dpgs.sendData");
						});
						
					}

It seems like I can’t get dpfs to fire. I receive the alert “dpgs.sendData”, which indicates that it passes the event when I click on the “Save” button in the popup window. Data is also saved to the database. However, since dpfs doesn’t get to “onAfterUpdate”, I don’t get the alert for “action”, and the popup window doesn’t close (when the line is uncommented).

I also tried using “onAfterUpdateFinish”, that didn’t work either.

Thanks!
K.

Here’s the debug log:

Current state
 ID:1339200505185 Status: inserted, valid
--------------------------------------------------------------------------------
Current mode: cell

 Log:
 row 1339200505185 marked [inserted,valid]

 Initiating data sending for all rows 

 Sending all data at once

 Server url: php/student_details.php parameters


null

 Server response received details
<?xml version='1.0' ?><data><action type='inserted' sid='1339200505185' tid='108' ></action></data>

Be sure that

a) both connector.js and dhtmlxdataprocessor.js are included on the page
b) connector.js is included AFTER dhtmlxdataprocessor.js
c) if you are using latest dhtmlx component - you need to use latest version of connector as well. ( included in component’s package )

Hi Stan,

Thanks for the reply.

I tried your suggestions, the only change I made was to move connector.js to be after dhtmlxdataprocessor.js. onAfterUpdate still does not fire.

The versions that I’m using are:

  • dhtmlxConnector_php_v10_110725
  • dhtmlxSuite 2011 Rel.1 (DHTMLX 3.0) build 110713

Any other suggestions?

Thanks so much,
K.

Try to update connector.js and dataprocessor.js to the latest version (attached)
dhtmlxdataprocessor_lt.zip (6.48 KB)

Hi Stan,

Thanks for your reply.

I downloaded your zip of the latest versions of connector and dataprocessor. This did not resolve the issue.

I’ve uploaded my files to my other thread, if you want to take a look.

Thanks so much!
K.

Problem was in dhtmlxdataprocessor_debug.js, just remove it or replace with the attached one.

Hi Stan,

Thanks for looking into this.

How did you debug it to conclude it was the dataprocessor_debug?

p.s. did you attach the correct version of it?

Thanks,
K.

Sorry, forgot to attach the fixed file somehow :confused:
Here it is

How did you debug it to conclude it was the dataprocessor_debug?
Just checked call stack of js error (one of default features of Chrom-dev-tools), which occurs while after-saving callback is processing.
dhtmlxdataprocessor_debug.zip (2.27 KB)