PDA

View Full Version : [CLOSED] EventMask question on button click event



wangyi
Dec 27, 2013, 2:33 AM
My requirement: When I pressed the button "Btn1", it pop the notify window. When I choose "Yes ", I need show the EventMask with the message "Please wait..."; When I choose "No", It did not show the EventMask and return directly.

The following is my code .
But the the EventMask is not appear.
How can I let it show when I choose "Yes"??




<ext:Button ID="Btn1" runat="server" Text="Do">
<DirectEvents>
<Click OnEvent="Btn1Click">
<EventMask ShowMask="true" Msg="Please wait..." />
</Click>
</DirectEvents>
</ext:Button>


protected void Btn1Click (object sender, DirectEventArgs e)
{
X.Msg.Confirm("Info", "Are you sure do this?", new Ext.Net.MessageBoxButtonsConfig
{
Yes = new Ext.Net.MessageBoxButtonConfig
{
Handler = "App.direct. DoThing ()",
Text = "Yes
},
No = new Ext.Net.MessageBoxButtonConfig
{
Text = "No"
}
}).Show();
}


[DirectMethod]
public void DoThing()
{
}

Daniil
Dec 27, 2013, 4:52 AM
Hi @wangyi,

I am not sure I got the requirement well, but try this, please:

Yes = new Ext.Net.MessageBoxButtonConfig
{
Handler = "App.direct.DoThing({ eventMask: { showMask: true, msg: 'Please wait ...' }})",
Text = "Yes"
}

[DirectMethod]
public void DoThing()
{
System.Threading.Thread.Sleep(3000); // just to ensure you'll the mask
}