1. #1
    Sencha User
    Join Date
    Aug 2011
    Location
    India
    Posts
    180
    Vote Rating
    -7
    Answers
    1
    AtulDawkhare is infamous around these parts

      0  

    Default Answered: Grid with RowEditor, How to get the cancel event

    Hi
    I have a Grid with Row Editor. I have disabled the on row Editor on Row click using "beforeedit " event.
    and I have action column where edit and delete functionality is coded.

    In my requirement , I wanted to disabled/hide the edit and delete image on Edit image click. I have done this.

    Now My query is , i want to enabled / show the image on Rodeditor's cancel button click. But I am not able to catch the cancel event.

    I have tried following ways

    Code:
     myGrid.on('canceledit', function(grid,eOpts )
           { 
                alert('Test');
         });
    Code:
               rowEditing.on('canceledit', function(grid,eOpts ) 
                      {
                           alert('Test');
                   });
    Code:
      rowEditing.on({
            scope: this,
            canceledit: function(roweditor, changes, record, rowIndex) {
               alert("user clicked the cancel button");
            }
        });
    But no success. Can you please tell me how do I get the Row Editors Cancel event so that I can enable/ show Action column images.

  2. Which version do you use? With 4.0.2a, Ext.grid.plugin.RowEditing won't fire canceledit event.

    With 4.0.7 or higher, it will fire canceledit event, so you can capture it from your plugin by using listeners config or addListener.
    Code:
    ....
    plugins: [{
        ptype: 'rowediting',
        autoCancel: false,
        listeners: {
            canceledit: function(){
                console.log('canceledit is fired');
            }
       }
    }]
    ...
    With 4.1.0-beta-1 or higher, you can catch canceledit event from you grid, but with 4.0.7, you can't because the grid won't relay this event.

  3. #2
    Sencha User
    Join Date
    Jan 2012
    Posts
    1,376
    Vote Rating
    112
    Answers
    346
    vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all

      0  

    Default

    Which version do you use? With 4.0.2a, Ext.grid.plugin.RowEditing won't fire canceledit event.

    With 4.0.7 or higher, it will fire canceledit event, so you can capture it from your plugin by using listeners config or addListener.
    Code:
    ....
    plugins: [{
        ptype: 'rowediting',
        autoCancel: false,
        listeners: {
            canceledit: function(){
                console.log('canceledit is fired');
            }
       }
    }]
    ...
    With 4.1.0-beta-1 or higher, you can catch canceledit event from you grid, but with 4.0.7, you can't because the grid won't relay this event.

  4. #3
    Sencha User
    Join Date
    Aug 2011
    Location
    India
    Posts
    180
    Vote Rating
    -7
    Answers
    1
    AtulDawkhare is infamous around these parts

      0  

    Default

    Thank you so much. Yes I was using 4.0.2a . now upgraded to 4.0.7 and Its working fine.

    Thanks once again

Thread Participants: 1