1. #1
    Sencha User Fire-Dragon-DoL's Avatar
    Join Date
    Dec 2011
    Posts
    140
    Answers
    9
    Vote Rating
    1
    Fire-Dragon-DoL is on a distinguished road

      0  

    Default 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.

  2. 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 );
            }
    } );

  3. #2
    Sencha User Fire-Dragon-DoL's Avatar
    Join Date
    Dec 2011
    Posts
    140
    Answers
    9
    Vote Rating
    1
    Fire-Dragon-DoL is on a distinguished road

      0  

    Default


    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.

  4. #3
    Sencha User Fire-Dragon-DoL's Avatar
    Join Date
    Dec 2011
    Posts
    140
    Answers
    9
    Vote Rating
    1
    Fire-Dragon-DoL is on a distinguished road

      0  

    Default


    Does anyone know if this is a bug? If yes, where can I post for it?

  5. #4
    Sencha User Tim Toady's Avatar
    Join Date
    Feb 2010
    Location
    Pennsylvania
    Posts
    536
    Answers
    61
    Vote Rating
    70
    Tim Toady is a jewel in the rough Tim Toady is a jewel in the rough Tim Toady is a jewel in the rough Tim Toady is a jewel in the rough

      0  

    Default


    I believe this is fixed in 4.1. Are you using 4.07?

  6. #5
    Sencha User Fire-Dragon-DoL's Avatar
    Join Date
    Dec 2011
    Posts
    140
    Answers
    9
    Vote Rating
    1
    Fire-Dragon-DoL is on a distinguished road

      0  

    Default


    I'm using ext 4.1 for sure (I dowloaded it recently), anyway are there any method that allow me to check ext version?

  7. #6
    Sencha User Fire-Dragon-DoL's Avatar
    Join Date
    Dec 2011
    Posts
    140
    Answers
    9
    Vote Rating
    1
    Fire-Dragon-DoL is on a distinguished road

      0  

    Default


    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.

  8. #7
    Sencha User Tim Toady's Avatar
    Join Date
    Feb 2010
    Location
    Pennsylvania
    Posts
    536
    Answers
    61
    Vote Rating
    70
    Tim Toady is a jewel in the rough Tim Toady is a jewel in the rough Tim Toady is a jewel in the rough Tim Toady is a jewel in the rough

      0  

    Default


    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.

  9. #8
    Sencha User Fire-Dragon-DoL's Avatar
    Join Date
    Dec 2011
    Posts
    140
    Answers
    9
    Vote Rating
    1
    Fire-Dragon-DoL is on a distinguished road

      0  

    Default


    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

  10. #9
    Sencha User Tim Toady's Avatar
    Join Date
    Feb 2010
    Location
    Pennsylvania
    Posts
    536
    Answers
    61
    Vote Rating
    70
    Tim Toady is a jewel in the rough Tim Toady is a jewel in the rough Tim Toady is a jewel in the rough Tim Toady is a jewel in the rough

      0  

    Default


    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 );
            }
    } );

  11. #10
    Sencha User Fire-Dragon-DoL's Avatar
    Join Date
    Dec 2011
    Posts
    140
    Answers
    9
    Vote Rating
    1
    Fire-Dragon-DoL is on a distinguished road

      0  

    Default


    Thanks a lot, worked well!

Thread Participants: 1

Tags for this Thread