简体   繁体   English

RowEditing中的“触发更新”按钮

[英]Trigger Update button in RowEditing

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. 通过这种方式,我仍然必须单击按钮更新或按Enter来触发编辑操作。 I managed to hide the buttons update and cancel. 我设法隐藏了按钮的更新和取消。

您可以使用下面的代码片段触发更新按钮(代码片段):-

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM