ext.net Javascript多功能点击事件之前

时间:2016-06-06 13:28:04

标签: javascript asp.net ext.net

我定义了自己的函数,我想在function1 AND 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>

它没有检查&#34; hasSelection&#34;功能完全

2 个答案:

答案 0 :(得分:1)

你的意思是包括&#34; hasSelection()&#34;作为controlsAreValid函数中的arg。

尝试:

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

答案 1 :(得分:0)

我认为问题是由错误的括号引起的,请尝试这样做:

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