PDA

View Full Version : [CLOSED] Ext Notification



snow_cap
Jul 07, 2014, 9:18 PM
Hello,
we want to show an Ext notification from code behind with content= another web form, for that we use below:

Ext.Net.Notification.Show(new Ext.Net.NotificationConfig
{
Title = "Notification",
Icon = Ext.Net.Icon.Information,
Width = 550,
Height = 300,
AutoHide = false,
AutoLoad = new Ext.Net.LoadConfig
{
Url = "ToolbarOverflow.aspx",
Scripts = true
}
});
In All IE versions will throw unlimited js exception , In Chrome and Firefox ,the notification window will apprear, but with the content web form will be loaded on the parent page not into the notification window.
how we can use Ext Notification with Autoload?

Note that this behavior is with Ext 2.5.2 and Ext 2.4 with one difference, in Ext 2.4 will not load any content page, only a blank notification window wil appear.

Thank you.

Daniil
Jul 08, 2014, 6:17 AM
Hi @snow_cap,

You probably need to load the page as an iframe. Please try:

AutoLoad = new Ext.Net.LoadConfig
{
Url = "ToolbarOverflow.aspx",
CustomConfig =
{
new ConfigItem("renderer", "frame")
}
}

Though, I would highly recommend to avoid iframes if possible. It might be too overhead. What is the content and functionality of ToolbarOverflow.aspx? I believe it might be organized as a user control, at least.

snow_cap
Jul 08, 2014, 8:04 AM
Thank you it worked.
ToolbarOverflow.aspx it's just a test page, in fact we use another webform that bind data to Store.

Thank you again.

snow_cap
Jul 08, 2014, 10:18 AM
Hello again,
Unfortunately it didn't worked with all IE versions, it throw js exception but finally will load successfully the page.
below the updated code behind:

Ext.Net.Notification.Show(new Ext.Net.NotificationConfig
{
Title = "Notification",
Icon = Ext.Net.Icon.Information,
Width = 550,
Height = 300,
AutoHide = false,
AutoLoad = new Ext.Net.LoadConfig
{
Url = "ToolbarOverflow.aspx",
Scripts = true,
CustomConfig = { new ConfigItem("renderer", "frame") }
}
});
Second problem with all browsers, it's the noification window title layout, for that please find attached screen shot.

Thank you again.

Daniil
Jul 08, 2014, 11:01 AM
I've reproduced both the issues. Yes, it might be problematic to load an iframe as a Notification. Or, maybe, even not supported.

Do you not want to try to get rid of an iframe? We could assist.

snow_cap
Jul 11, 2014, 1:30 PM
Hello,

we need to use Ext Notification, so any new idea will be appreciated.
the main idea that the notification content must be processed on another web form for performance benefit.
we used to use it wit Ext 1.x without any issue.

thank you again.

Daniil
Jul 11, 2014, 3:37 PM
Please try this.

Ext.Net.Notification.Show(new Ext.Net.NotificationConfig
{
Title = "Notification",
Icon = Ext.Net.Icon.Information,
Width = 550,
Height = 300,
AutoHide = false,
AutoLoad = new Ext.Net.LoadConfig
{
Url = "Test.aspx",
CustomConfig =
{
new ConfigItem("renderer", "frame"),
new ConfigItem("autoLoad", "false")
}
},
Listeners =
{
Show =
{
Handler = "this.load();"
}
}
});

snow_cap
Jul 11, 2014, 4:31 PM
it worked when loading the notification window, but when we click the close button it throw js exception : Ext is undefined, i think it's from the animation,can we just destroy the window to solve it?

Daniil
Jul 11, 2014, 6:03 PM
I cannot reproduce. Here is my test case.

Example

<%@ Page Language="C#" %>

<script runat="server">
protected void Notify(object sender, DirectEventArgs e)
{
Ext.Net.Notification.Show(new Ext.Net.NotificationConfig
{
Title = "Notification",
Icon = Ext.Net.Icon.Information,
Width = 550,
Height = 300,
AutoHide = false,
AutoLoad = new Ext.Net.LoadConfig
{
Url = "Test.aspx",
CustomConfig =
{
new ConfigItem("renderer", "frame"),
new ConfigItem("autoLoad", "false")
}
},
Listeners =
{
Show =
{
Handler = "this.load();"
}
}
});
}
</script>

<!DOCTYPE html>

<html>
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />

<ext:Button runat="server" Text="Notify" OnDirectClick="Notify" />
</form>
</body>
</html>

snow_cap
Jul 12, 2014, 12:14 AM
Ext Notification is unstable, that's why sometimes on close will throw exceptions, sometimes will not, and on show 80% will be okay and 20% will throw exceptions; even i tried to put setTimeout for this.Load() with no success.
Any clue to get rid of these js exceptions using IE? we can't lose such functionality we used to use perfectly with 1.x versions.

Daniil
Jul 12, 2014, 10:10 AM
Ext Notification is unstable, that's why sometimes on close will throw exceptions, sometimes will not, and on show 80% will be okay and 20% will throw exceptions; even i tried to put setTimeout for this.Load() with no success.

Please clarify does it happen with my test case?