1

是否可以通过单击我要编辑的行来触发行编辑中的更新按钮?

我有这个:

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) {


            }

        }
    })
]

这工作得很好,但我想在我点击一次我想编辑的行时让它更新。通过这种方式,我仍然必须单击按钮更新或按回车来触发编辑操作。我设法隐藏按钮更新和取消。

4

1 回答 1

0

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

your_grid.getPlugin('your_plugin_id').editor.down('button[itemId=update]').fireHandler();
于 2018-04-17T11:14:23.283 回答