Trigger Update button in RowEditing

677 Views Asked by At

Is it possible to trigger the update button in a Row-editing by just clicking the row I want to edit ?

I have this:

plugins: [
    Ext.create('Ext.grid.plugin.RowEditing', {
        clicksToEdit: 1,
        saveBtnText: 'Actualizar',
        cancelBtnText: 'Cancelar',
        listeners: {
            edit: function(editor, context, eOpts) {
                SgaWeb.app.getController('app').function()
            },
            canceledit: function(editor, context, eOpts) {
                var fila = me.store.getAt(0);
                if (fila.get('codigoDato') == '0') {
                    me.store.removeAt(0);
                }
            },
            beforeedit: function(editor, context, eOpts) {
                editor.getEditor().floatingButtons.hide();
                //alert(context.record.get('codGenero'));                                                                                                                                                                                                            
            },
            validateedit: function(editor, context, eOpts) {


            }

        }
    })
]

This is working just fine but I want to make it update when I click once the row I want to edit. By this way I still have to click the button update or pressing enter to trigger the edit action. I managed to hide the buttons update and cancel.

1

There are 1 best solutions below

0
On

You can use below code snippet to trigger update button (code snippet) :-

your_grid.getPlugin('your_plugin_id').editor.down('button[itemId=update]').fireHandler();