I have a button,I want to form validation(client side) before direct click event fire.I tryed lots of way but failed.
** I already set textbox like this.
<ext:TextField ID="Ad" runat="server" FieldLabel="Dem ad" Flex="1" AllowBlank="false" CausesValidation="true"> </ext:TextField>
but still fire direct even before textbox checking
<ext:Button ID="Button1" runat="server" Text="save" Icon="Disk">
<DirectEvents>
<Click OnEvent="Dem">
<Confirmation ConfirmRequest="true" Title="Title" Message="are u sure you want to update..." />
</Click>
</DirectEvents>
</ext:Button>
There is a few options.
You can return false from a DirectEvent's Before handler or from the same Listener.
protected void Submit(object sender, DirectEventArgs e) { X.Msg.Alert("Submit", "Submitted").Show(); }Ext.NET v2 Example
Another approach is using FormBind. It automatically disables a component if a FormPanel is invalid. A component should belong to a FormPanel.
protected void Submit(object sender, DirectEventArgs e) { X.Msg.Alert("Submit", "Submitted").Show(); }Ext.NET v2 Example
You can listen a FormPanel's ValidityChange event to apply some custom actions.