在一个ext.net按钮中设置多个事件

时间:2015-06-08 12:17:38

标签: javascript events extjs ext.net

我有一个带有网格和字段的表单。当我点击提交按钮时,我需要发送所有信息做数据库。之后,我需要重定向到其他页面。实际上,我的代码显示为如此,但重定向事件未触发。

<ext:Button runat="server" Text="Finalizar"  Width="150" ID="Button1" Disabled="true" >
    <DirectEvents>
        <Click OnEvent="SalvarDados"
               Success="
                #{Store1}.sync();
                #{Store2}.sync();
                #{Store3}.sync();
                #{Store4}.sync();
                #{Store5}.sync();
                #{Store6}.sync();
                #{Store7}.sync();
                #{Store8}.sync();
                RedirectPageEvent;">
            <Confirmation ConfirmRequest="true" Title="Confirmação" Message="Confirm?" />
            <EventMask ShowMask="true" Msg="Salvando..." />
        </Click>
    </DirectEvents>
</ext:Button>

事件:

protected void DirectGeraDocumento(object sender, DirectEventArgs e) {
    Context.Response.Redirect("GeraDocumento.aspx");    
}

1 个答案:

答案 0 :(得分:0)

临时解决问题。它工作正常,但我不确定超时的功能,为什么这取决于服务器的响应时间。如果有人知道更好的方式,我会贬低。谢谢!

<Click OnEvent="SalvarDados"
               Success="
                #{Store1}.sync();
                #{Store2}.sync();
                #{Store3}.sync();
                #{Store4}.sync();
                #{Store5}.sync();
                #{Store6}.sync();
                #{Store7}.sync();
                #{Store8}.sync();
                setTimeout(function(){ location.assign('GeraDocumento.aspx'); }, 1500);">
            <Confirmation ConfirmRequest="true" Title="Confirmação" Message="Confirm?" />
            <EventMask ShowMask="true" Msg="Salvando..." />
        </Click>