PDA

View Full Version : RowEditing plugin doesn't fire canceledit when changing row



Fire-Dragon-DoL
23 May 2012, 10:24 AM
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.

Fire-Dragon-DoL
23 May 2012, 4:28 PM
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.

Fire-Dragon-DoL
24 May 2012, 7:30 AM
Does anyone know if this is a bug? If yes, where can I post for it?

Tim Toady
24 May 2012, 8:31 AM
I believe this is fixed in 4.1. Are you using 4.07?

Fire-Dragon-DoL
24 May 2012, 10:17 AM
I'm using ext 4.1 for sure (I dowloaded it recently), anyway are there any method that allow me to check ext version?

Fire-Dragon-DoL
24 May 2012, 10:32 AM
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.

Tim Toady
24 May 2012, 10:56 AM
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.

Fire-Dragon-DoL
24 May 2012, 11:16 AM
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/showthread.php?208635-4.1.0-Row-editing-plugin-doesn-t-fire-quot-canceledit-quot-when-changing-row

Tim Toady
24 May 2012, 12:14 PM
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.


Ext.define( 'YourApp.patch.RowEditing', {
override: 'Ext.grid.plugin.RowEditing',
startEdit: function() {
if( this.editing ) {
this.cancelEdit();
}
this.callParent( arguments );
}
} );

Fire-Dragon-DoL
24 May 2012, 12:35 PM
Thanks a lot, worked well!

hbulens
1 Jun 2018, 2:54 AM
I noticed the same problem occurs in 6.0.2. So it has actually never been fixed.?