Re-enable grid after editor close on save without changes

  1. #1

    Re-enable grid after editor close on save without changes

    Hello,

    I'm facing a problem: I have a Window with a GridPanel with RowEditor definition. In it's BeforeEdit event I disable the close button of the window to prevent closing it during editing:

    Grid's Plugin definition
                    <Plugins>
                        <ext:RowEditor ID="rowEditorFuncAsoc" ErrorSummary="false" runat="server" SaveText="Guardar" CancelText="Cancelar" ErrorText="Advertencia" CommitChangesText="Antes de continuar debe guardar los cambios o cancelar.">
                            <Listeners>
                                <BeforeEdit Fn="deshabilitarFuncAsoc"/>
                                <ValidateEdit Fn="habilitarFuncAsoc" />
                                <CancelEdit AutoPostBack="false" Fn="deshabilitarFuncAsoc"/>
                            </Listeners>
                            <DirectEvents>
                                <AfterEdit OnEvent="agregarFuncionario">
                                    <ExtraParams>
                                        <ext:Parameter Mode="Raw" Name="n_fila" Value="Ext.encode(#{grdFuncAsoc}.getRowsValues({selectedOnly:true}))"></ext:Parameter>
                                        <ext:Parameter Mode="Raw" Name="d_fila" Value="Ext.encode(#{grdDocumento}.getRowsValues({selectedOnly:true}))"></ext:Parameter>
                                    </ExtraParams>
                                    <EventMask MinDelay="250" ShowMask="true" />
                                </AfterEdit>
                            </DirectEvents>
                        </ext:RowEditor>
                    </Plugins>
    Javascript functions to disable and enable window's close buttons and the grid itself:
                var habilitarFuncAsoc = function(){
                    $('input:hidden[name=inpAccion]').val('false');
                    Ext.getCmp('#{grdFuncAsoc}').setDisabled(false);
                    Ext.getCmp('#{btnCerrarAsoc}').setDisabled(false);
                    enableHide(Ext.getCmp('#{winFuncAsoc}'));
                }
    
                var deshabilitarFuncAsoc = function(editor, rowIndex){
                    Ext.getCmp('#{grdFuncAsoc}').setDisabled(true);
                    Ext.getCmp('#{btnCerrarAsoc}').setDisabled(true);
                    disableHide(Ext.getCmp('#{winFuncAsoc}'));
                    return true;
                }
    When I click the Cancel button in the row editor, or click the Save button with changes made, the grid and close buttons get enabled again. But if I click Save button without changes made to editors, the grid and buttons don't get enabled again because the function habilitarFuncAsoc is not called, ValidateEdit don't fire in this case, nor AfterEdit event.

    What could I do to re-enable the grid and close buttons after Save without changes?
    Thank you
    Regards
    Alex
  2. #2
    Hello

    Somebody has a hint on this?
    Thank you
  3. #3
    Do somebody has a light on this?

Similar Threads

  1. Replies: 1
    Last Post: Nov 25, 2013, 11:43 AM
  2. [CLOSED] ComponentColumn editor does not save values
    By marco.morreale in forum 2.x Legacy Premium Help
    Replies: 6
    Last Post: Jan 18, 2013, 8:55 AM
  3. Replies: 5
    Last Post: Dec 26, 2011, 5:39 AM
  4. Replies: 5
    Last Post: Jan 26, 2010, 5:46 PM
  5. how to save the changings done by editor
    By pearl in forum 1.x Help
    Replies: 0
    Last Post: Sep 30, 2009, 1:43 AM

Posting Permissions