-
23 May 2012 10:24 AM #1
Answered: RowEditing plugin doesn't fire canceledit when changing row
Answered: RowEditing plugin doesn't fire canceledit when changing row
Even with autocancel, I can't fire in any way "canceledit" event. Is this a bug? How can I detect when I move the roweditor or how can I eventually PREVENT roweditor movement at least?
It's a big issue for me because I'm trying to remove "newly created items" and I must check if the current created item is temporary or not, if I can't detect when this item is changed it creates me a lot of issues.
-
Best Answer Posted by Tim Toady
Here is a quick and dirty override that should do what you want. Sorry it took so long. I had something come up and also had to look into the way overriding is done in 4.1.
Code:Ext.define( 'YourApp.patch.RowEditing', { override: 'Ext.grid.plugin.RowEditing', startEdit: function() { if( this.editing ) { this.cancelEdit(); } this.callParent( arguments ); } } );
-
23 May 2012 4:28 PM #2
Notice that I've found a temporary solution to this by intercepting the beforeedit event, but I think that when you click to move the rowEditor on a different row, canceledit event should definitely be fired.
-
24 May 2012 7:30 AM #3
Does anyone know if this is a bug? If yes, where can I post for it?
-
24 May 2012 8:31 AM #4
I believe this is fixed in 4.1. Are you using 4.07?
-
24 May 2012 10:17 AM #5
I'm using ext 4.1 for sure (I dowloaded it recently), anyway are there any method that allow me to check ext version?
-
24 May 2012 10:32 AM #6
Nevermind, I download the package again.
Anyway, if autoCancel is set to true and no changes have been done, when I move the roweditor, canceledit is not fired. If changes have been done, the changes are reverted but canceledit is not fired
If Autocancel is set to false and you try to move the editor when no changes have been done, it doesn't fire any event. If changes have been done, the editor won't change the row.
I think the bold part isn't working as it should, because it doesn't run "canceledit" event.
-
24 May 2012 10:56 AM #7
I see what you are saying. There was an issue in 4.07 with canceledit not being relayed to the controller, but obviously this is a different issue. I am not sure if this is a bug or not though. Is an edit considered canceled if it is just moved? You may want to submit a bug report. Just post it in the bugs forum for 4.x. I will write a quick override and post it here for you.
-
24 May 2012 11:16 AM #8
Ok I'll post it as a bug. Well, I consider that if in some way the edit is "canceled", canceledit should be fired. For me, at least, sounds logical
EDIT: here you can find the bug report thread
http://www.sencha.com/forum/showthre...n-changing-row
-
24 May 2012 12:14 PM #9
Here is a quick and dirty override that should do what you want. Sorry it took so long. I had something come up and also had to look into the way overriding is done in 4.1.
Code:Ext.define( 'YourApp.patch.RowEditing', { override: 'Ext.grid.plugin.RowEditing', startEdit: function() { if( this.editing ) { this.cancelEdit(); } this.callParent( arguments ); } } );
-
24 May 2012 12:35 PM #10


Reply With Quote