我定义了自己的函数,并且当function1和function2不正确时我想返回错误

到目前为止的代码:

<Buttons>
        <ext:Button ID="ButtonSaveZgoda" runat="server" Text="Zapisz" Icon="Disk">
            <DirectEvents>
                <Click OnEvent="SaveZgody" Failure="Ext.Msg.alert('Komunikat', result.errorMessage);"
                    Before="return controlsAreValid(#{dateFieldDataDecyzjiNowaZgoda},#{ComboBoxZmianaNowaZgoda},#{FileUploadNowaZgoda} && hasSelection())"
                    Success="#{GridPanelLista}.reload();#{WindowAdd}.hide();">
                    <EventMask ShowMask="true" />
                    <ExtraParams>
                        <ext:Parameter Name="daneOsobowe" Value="Ext.encode(getDataFromDaneOsobowe())" Mode="Raw" />
                    </ExtraParams>
                </Click>
            </DirectEvents>
        </ext:Button>
    </Buttons>


它根本不检查“ hasSelection”功能

最佳答案

您是否要在“ controlsAreValid”函数中将“ hasSelection()”作为arg包含在内。

尝试:

Before="return controlsAreValid(#{dateFieldDataDecyzjiNowaZgoda},#{ComboBoxZmianaNowaZgoda},#{FileUploadNowaZgoda}); hasSelection()"

10-05 18:44