ext.net 按钮点击直接事件

ext.net button click direct events

我有一个包含许多字段集和网格面板的大表单,我需要使用一个确认按钮提交所有数据。实际上我正在使用这个:

<ext:Button runat="server" Text="Finalizar"  Width="150" ID="Button1" Disabled="true">
                    <DirectEvents>
                        <Click OnEvent="SalvarDados" After="#{StoreVerifLimpeza}.sync();">
                            <Confirmation ConfirmRequest="true" Title="Confirmação" Message="Confirm?" />
                            <EventMask ShowMask="true" Msg="Salvando..." />
                        </Click>
                    </DirectEvents>
                </ext:Button>

但显然 after 操作在 OnEvent 之前触发。因为我在 SalvaDadosVerifLimpezaGrade_BeforeRecordInserted 中设置了一个 foreign,这个 var 是空的。我试图找到 directevents click 的一些文档,但没有找到任何东西。

试试这个替代方案:

<script runat="server">
    // c#
    [DirectMethod]
    public void SalvarDados(){
        // ... your code here
    }
</script>

<ext:XScript runat="server">
<sctipt type="text/javascript">
    function finalizar(){
        Ext.Msg.confirm('Confirmação', 'Confirm?', function(btn){
            if (btn == 'yes'){
                showWaitBox();
                App.direct.SalvarDados({
                    success: function(){
                        #{StoreVerifLimpeza}.sync();
                        Ext.MessageBox.close();
                    }
                });
            }
        });
    }

    function showWaitBox(timeout){
        Ext.MessageBox.wait('Salvando...');
        setTimeout(function() { Ext.MessageBox.hide() }, timeout ? timeout : 30000);
    }   
</script>
</ext:XScript>

<ext:Button runat="server" Text="Finalizar"  Width="150" ID="Button1" Disabled="true" Handler="finalizar();">