PDA

View Full Version : [OPEN-1218] CRUD Grid Multi Delete



codeart.ch
12 Aug 2010, 4:15 PM
Hello, could this probably be a bug ?


http://www.sencha.com/forum/showthread.php?106866-CRUD-Grid-Multi-Delete

My current Ext Version: Ext 3.3 b1
Browser: Firefox 3.6.8

Greetings Simon

codeart.ch
17 Aug 2010, 3:11 AM
I have found a workaround for my problem.



this.getStore().autoSave = false;
this.getStore().remove(delItems);
this.getStore().save();
this.getStore().autoSave = true;


So its possible to delete multiple Rows with one CRUD request.

But if i dont use this "fix" the CRUD destroy command makes still bugged single requests.

If i delete three rows there are made three Requests like:

-Request 1 - delete.php -> Id:1
-Request 2 - delete.php -> Id:1,2
-Request 3 - delete.php -> Id:1,2,3

i think it should be:

-Request 1 - delete.php -> Id:1
-Request 2 - delete.php -> Id:2
-Request 3 - delete.php -> Id:3

Animal
17 Aug 2010, 4:01 AM
If the delete did not (as far as the Store knows) complete successfully, then the next time it synchs with the server, it will try again.

So what does the reply from these deletes tell the Store about what happened?

You MUST use exception listeners to check for errors when using a writable Store.

Condor
17 Aug 2010, 5:02 AM
No, the problem is not that the server responds with errors. It's just that the server hasn't had time to respond yet.

When removing 3 records in autoSave:true mode you would have to wait for the store write event before allowing the next record to be deleted. Otherwise it will send 1, 1+2 and 1+2+3, because the server hasn't responded yet to first 2 requests.

And, as you've correctly stated, autoSave:false mode for multiple records still has bugs.