Oct 04, 2016, 2:51 PM
[CLOSED] Status Bar with Troubles
Hi Ext.Net Team !!
Please check the code sample below:
Follow these steps
Step 1. Click Button "Open Window 2"
Step 2. Click StatusBar "Ready"
Step 3. Type Field "Name"
Step 4. Selected Date Field "Birthdate"
Step 5. Close Window 2
Step 6. Click Button "Open Window 2"
Step 7. Click StatusBar "Ready"
Can you help with the code?
I accept suggestions ideas or comments
Please check the code sample below:
<%@ Page Language="C#" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
}
protected void FormSave(object sender, DirectEventArgs e)
{
FormStatusBar.SetStatus(new StatusBarStatusConfig { Text = "Form saved!", IconCls = "", Clear2 = true });
Window2.Hide();
}
protected void Button1_Click(object sender, DirectEventArgs e)
{
StatusForm.Reset();
FormStatusBar.ClearStatus(new StatusBarClearStatusConfig() { UseDefaults = true });
Window2.Show();
}
</script>
<!DOCTYPE html>
<html>
<head id="Head1" runat="server">
<title>Edit Form View - Ext.NET Examples</title>
<link href="/resources/css/examples.css" rel="stylesheet" />
<style type="text/css">
.x-status-error-list
{
/*z-index: #{Window2}.el.getStyle('z-index') + 1*/
z-index: 99999
}
</style>
</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" IDMode="Explicit" Theme="Neptune" />
<ext:Window ID="Window1" runat="server"
Title="Window1"
Icon="ApplicationEdit"
Width="800"
Height="400"
BodyPadding="15"
Resizable="true"
Closable="false"
Layout="Fit">
<Items>
<ext:FormPanel ID="FormPanel1" runat="server"
Border="false"
Layout="Form">
<Items>
<ext:Button ID="Button1" runat="server" Text="Open Window 2" >
<DirectEvents>
<Click OnEvent="Button1_Click" ></Click>
</DirectEvents>
</ext:Button>
</Items>
</ext:FormPanel>
</Items>
</ext:Window>
<ext:Window ID="Window2" runat="server"
Title="StatusBar with Integrated Form Validation"
Modal="true"
Width="350"
Height="220"
Layout="Fit"
Hidden="true"
Closable="true">
<Listeners>
<Close Handler="App.FormStatusBar.plugins[0].msgEl.hide();" />
</Listeners>
<BottomBar>
<ext:StatusBar ID="FormStatusBar" runat="server"
DefaultText="Ready"
IconCls="">
<Plugins>
<ext:ValidationStatus ID="ValidationStatus1"
runat="server"
FormPanelID="StatusForm"
ValidIcon="Accept"
ErrorIcon="Exclamation" />
</Plugins>
</ext:StatusBar>
</BottomBar>
<Items>
<ext:FormPanel ID="StatusForm" runat="server"
LabelWidth="75"
ButtonAlign="Right"
Border="false"
Padding="10">
<Defaults>
<ext:Parameter Name="Anchor" Value="95%" />
<ext:Parameter Name="AllowBlank" Value="false" Mode="Raw" />
<ext:Parameter Name="SelectOnFocus" Value="true" Mode="Raw" />
<ext:Parameter Name="MsgTarget" Value="side" />
</Defaults>
<Items>
<ext:TextField ID="TextField1" runat="server" FieldLabel="Name" BlankText="Name is required" />
<ext:DateField ID="DateField1" runat="server" FieldLabel="Birthdate" BlankText="Birthdate is required" />
</Items>
<Buttons>
<ext:Button ID="Button2" runat="server" Text="Save" Icon="Disk">
<DirectEvents>
<Click
OnEvent="FormSave"
Before="var valid= #{StatusForm}.getForm().isValid(); if (valid) {#{FormStatusBar}.showBusy('Saving form...');} return valid;">
<EventMask
ShowMask="true"
MinDelay="1000"
Target="CustomTarget"
CustomTarget="={#{StatusForm}.getEl()}"
/>
</Click>
</DirectEvents>
</ext:Button>
</Buttons>
</ext:FormPanel>
</Items>
</ext:Window>
</form>
</body>
</html>
When I tested my project, I've encountered an issue of the StatusBar control, by opening and closing the window and click on the StatusBar control “Readyâ€, at second try appears again the validation errors, how you can see in the next pics:Follow these steps
Step 1. Click Button "Open Window 2"
Step 2. Click StatusBar "Ready"
Step 3. Type Field "Name"
Step 4. Selected Date Field "Birthdate"
Step 5. Close Window 2
Step 6. Click Button "Open Window 2"
Step 7. Click StatusBar "Ready"
Can you help with the code?
I accept suggestions ideas or comments
Last edited by fabricio.murta; Oct 29, 2016 at 8:46 PM.