Problem with updating grid after inserting deleting rows

I have еру next behaviour:

i insert new rows from clipboard into my grid; after that i call sendData() method of dataprocessor and reload table

	function create_grid(){
		query = "";
		mygrid.clearAll();
		if (((value_client*1) != 0) && ((value_source*1) != 0)) {
			query = "?condition=where idClient="+value_client+" and idSrc="+value_source+" ";
			} 
		else if (((value_client*1) == 0) && ((value_source*1) != 0)) {
			query = "?&idSrc="+value_source;	
			query = "?condition=where idSrc="+value_source;
		}
		else if (((value_client*1) != 0) && ((value_source*1) == 0)) {
			query = "?idClient="+value_client;
			query = "?condition=where idClient="+value_client;
		}
		dp.serverProcessor = "clientsrouts_grid.php"+query;
		mygrid.loadXML("clientsrouts_grid.php"+query);
		}

	function sync_with_DB() {
		dp.sendData();
	}
	function sync(){
		sync_with_DB(); 
		create_grid();
	}

After that i deleted new rows and call sendData() again.
Then i try to insert the deleted rows from clipboard again and my table on the server didn’t update but when i reload the current page all is ok. How to resolve this?

What’s the response if you 've updated?

This is my log



====================================
Log started, 06/09/2011 05:09:56
====================================

SELECT  TOP 100  id, idClient, idSrc, Rout, flag2, flag1, Datetime_Enbl, Datetime_Dsbl, SW, TComm FROM ClientRouts WHERE ( idClient=355)

SELECT  COUNT(*) as DHX_COUNT  FROM ClientRouts WHERE ( idClient=355)

Done in 0,0039279460906982s



====================================
Log started, 06/09/2011 05:09:08
====================================

SELECT  TOP 100  id, idClient, idSrc, Rout, flag2, flag1, Datetime_Enbl, Datetime_Dsbl, SW, TComm FROM ClientRouts WHERE ( idClient=355)



====================================
Log started, 06/09/2011 05:09:08
====================================

While there is no edit mode mark, POST parameters similar to edit mode detected. \n Switching to edit mode ( to disable behavior remove POST[ids]

DataProcessor object initialized
7_gr_id => 7
7_c0 => 355
7_c1 => 13
7_c2 => data1
7_c3 => 0
7_c4 => 1
7_c5 => 01.06.2010 0:00
7_c6 => 
7_c7 => 13
7_c8 => 3
7_!nativeeditor_status => inserted
8_gr_id => 8
8_c0 => 355
8_c1 => 13
8_c2 => data2
8_c3 => 0
8_c4 => 1
8_c5 => 01.06.2010 0:00
8_c6 => 
8_c7 => 13
8_c8 => 3
8_!nativeeditor_status => inserted
ids => 7,8

SELECT  COUNT(*) as DHX_COUNT  FROM ClientRouts WHERE ( idClient=355)

Row data [7]
id => 7
idClient => 355
idSrc => 13
Rout => data1
flag2 => 0
flag1 => 1
Datetime_Enbl => 01.06.2010 0:00
Datetime_Dsbl => 
SW => 13
TComm => 3
!nativeeditor_status => inserted

change value of: Datetime_Enbl as: 2010-06-01 00:00:00

change value of: Datetime_Dsbl as: 

INSERT INTO ClientRouts(idClient,idSrc,Rout,flag2,flag1,Datetime_Enbl,Datetime_Dsbl,SW,TComm) VALUES ('355','13','data1','0','1','2010-06-01 00:00:00',Null,'13','3');SELECT @@IDENTITY AS dhx_id

Done in 0,0035910606384277s

Row data [8]
id => 8
idClient => 355
idSrc => 13
Rout => data2
flag2 => 0
flag1 => 1
Datetime_Enbl => 01.06.2010 0:00
Datetime_Dsbl => 
SW => 13
TComm => 3
!nativeeditor_status => inserted

change value of: Datetime_Enbl as: 2010-06-01 00:00:00

change value of: Datetime_Dsbl as: 

INSERT INTO ClientRouts(idClient,idSrc,Rout,flag2,flag1,Datetime_Enbl,Datetime_Dsbl,SW,TComm) VALUES ('355','13','data2','0','1','2010-06-01 00:00:00',Null,'13','3');SELECT @@IDENTITY AS dhx_id

Edit operation finished
0 => action:inserted; sid:7; tid:1784;
1 => action:inserted; sid:8; tid:1785;

Done in 0.0074610710144043s



====================================
Log started, 06/09/2011 05:09:10
====================================

SELECT  TOP 100  id, idClient, idSrc, Rout, flag2, flag1, Datetime_Enbl, Datetime_Dsbl, SW, TComm FROM ClientRouts WHERE ( idClient=355)

SELECT  COUNT(*) as DHX_COUNT  FROM ClientRouts WHERE ( idClient=355)

Done in 0,0038740634918213s



====================================
Log started, 06/09/2011 05:09:23
====================================

SELECT  TOP 100  id, idClient, idSrc, Rout, flag2, flag1, Datetime_Enbl, Datetime_Dsbl, SW, TComm FROM ClientRouts WHERE ( idClient=355)

SELECT  COUNT(*) as DHX_COUNT  FROM ClientRouts WHERE ( idClient=355)

Done in 0,0038540363311768s



====================================
Log started, 06/09/2011 05:09:23
====================================

While there is no edit mode mark, POST parameters similar to edit mode detected. \n Switching to edit mode ( to disable behavior remove POST[ids]

DataProcessor object initialized
1785_gr_id => 1785
1785_c0 => 355
1785_c1 => 13
1785_c2 => data2
1785_c3 => 0
1785_c4 => 1
1785_c5 => 01.06.2010 00:00:00
1785_c6 => 
1785_c7 => 13
1785_c8 => 3
1785_!nativeeditor_status => deleted
1784_gr_id => 1784
1784_c0 => 355
1784_c1 => 13
1784_c2 => data1
1784_c3 => 0
1784_c4 => 1
1784_c5 => 01.06.2010 00:00:00
1784_c6 => 
1784_c7 => 13
1784_c8 => 3
1784_!nativeeditor_status => deleted
ids => 1785,1784

Row data [1785]
id => 1785
idClient => 355
idSrc => 13
Rout => data2
flag2 => 0
flag1 => 1
Datetime_Enbl => 01.06.2010 00:00:00
Datetime_Dsbl => 
SW => 13
TComm => 3
!nativeeditor_status => deleted

DELETE FROM ClientRouts WHERE id='1785' AND (( idClient=355))

Row data [1784]
id => 1784
idClient => 355
idSrc => 13
Rout => data1
flag2 => 0
flag1 => 1
Datetime_Enbl => 01.06.2010 00:00:00
Datetime_Dsbl => 
SW => 13
TComm => 3
!nativeeditor_status => deleted

DELETE FROM ClientRouts WHERE id='1784' AND (( idClient=355))

Edit operation finished
0 => action:deleted; sid:1785; tid:1785;
1 => action:deleted; sid:1784; tid:1784;

Done in 0.0063121318817139s



====================================
Log started, 06/09/2011 05:09:25
====================================

SELECT  TOP 100  id, idClient, idSrc, Rout, flag2, flag1, Datetime_Enbl, Datetime_Dsbl, SW, TComm FROM ClientRouts WHERE ( idClient=355)

SELECT  COUNT(*) as DHX_COUNT  FROM ClientRouts WHERE ( idClient=355)

Done in 0,003507137298584s



====================================
Log started, 06/09/2011 05:09:29
====================================

SELECT  TOP 100  id, idClient, idSrc, Rout, flag2, flag1, Datetime_Enbl, Datetime_Dsbl, SW, TComm FROM ClientRouts WHERE ( idClient=355)

SELECT  COUNT(*) as DHX_COUNT  FROM ClientRouts WHERE ( idClient=355)

Done in 0,0034189224243164s



====================================
Log started, 06/09/2011 05:09:30
====================================

SELECT  TOP 100  id, idClient, idSrc, Rout, flag2, flag1, Datetime_Enbl, Datetime_Dsbl, SW, TComm FROM ClientRouts WHERE ( idClient=355)

SELECT  COUNT(*) as DHX_COUNT  FROM ClientRouts WHERE ( idClient=355)

Done in 0,0033140182495117s

It’s log of dataprocessor_debug

[code] Log:
row 7 marked [inserted,valid]
row 8 marked [inserted,valid]
row 9 marked [inserted,valid]
row 7 marked [updated,valid]
row 8 marked [updated,valid]
row 9 marked [updated,valid]
Initiating data sending for all rows
Sending all data at once
Server url: clientsrouts_grid.php?condition=where idClient=355 parameters

null

Server response received details

<?xml version='1.0' ?><data><action type='inserted' sid='7' tid='1789' ></action><action type='inserted' sid='8' tid='1790' ></action><action type='inserted' sid='9' tid='1791' ></action></data>

Incorrect SID, row with such ID not exists in grid
Action: inserted SID:7 TID:1789
row 7 unmarked [updated,valid]
row 1791 marked [deleted,valid]
row 1789 marked [deleted,valid]
row 1790 marked [deleted,valid]
Initiating data sending for all rows
Sending all data at once
Server url: clientsrouts_grid.php?condition=where idClient=355 parameters

null

Server response received details

<?xml version='1.0' ?><data><action type='deleted' sid='1791' tid='1791' ></action><action type='deleted' sid='1789' tid='1789' ></action><action type='deleted' sid='1790' tid='1790' ></action></data>

Action: deleted SID:1791 TID:1791
row 1791 unmarked [updated,valid]
row 1791 unmarked [updated,valid]
Action: deleted SID:1789 TID:1789
row 1789 unmarked [updated,valid]
row 1789 unmarked [updated,valid]
Action: deleted SID:1790 TID:1790
row 1790 unmarked [updated,valid]
row 1790 unmarked [updated,valid]
row 7 marked [inserted,valid]
row 8 marked [inserted,valid]
row 9 marked [inserted,valid]
row 7 marked [updated,valid]
row 8 marked [updated,valid]
row 9 marked [updated,valid]
Initiating data sending for all rows
Sending all data at once
Server url: clientsrouts_grid.php?condition=where idClient=355 parameters

null

row 7 marked [inserted,valid]
row 8 marked [inserted,valid]
row 9 marked [inserted,valid]
Initiating data sending for all rows
Sending all data at once
Server url: clientsrouts_grid.php?condition=where idClient=355 parameters[/code]

Please use Firefox and install Firebug. If you post data to your server the server must answer your post in a particular format.
Typical answers are for…
…delete a row:

<?xml version="1.0" encoding="UTF-8"?>
<data><action type='deleted' sid='{unique row id}' tid='{unique row id}'/></data>

…insert a new row:

<?xml version="1.0" encoding="UTF-8"?>
<data><action type='inserted' sid='{random row id}' tid='{new unique row id}'/></data>

I use firefox and as you can see insert operation done succescfull at first, but after deleting new rows are appeared in grid but not inserted into table on server.

Ok, my mistake. :smiley:
Try this:

mydp.attachEvent("onFullSync",function()
    {
        mygrid.clearAndLoad("{url}");
    });

‘mydp’ ist your dataprocessor.

cm1310,
thanks for reply but it don’t work. May be it is my mistake because i’m new in php and javascript, but i opened that when i don’t use setUpdateMode(“off”) all is ok and problems occures when i use this method.