PDA

View Full Version : [CLOSED] How I insert a button in ext.net.Notification?



supera
Feb 20, 2012, 1:42 PM
Hi

I wish to insert a button (with icon) in notifications. This button will call a method in code behind (or direct method) to remove the notification (in databank) and close the notification window.

It is possible? How i do? The example http://examples2.ext.net/#/MessageBox/Notification/Overview/ appears donīt work.

Thanks for any help.

Daniil
Feb 20, 2012, 3:26 PM
Hi,

Only via an <ext:Tool> in Tools.

Daniil
Feb 20, 2012, 4:30 PM
I forgot about ContentEl.

The following example will work with the next release.

Example

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

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
NotificationConfig cfg = new NotificationConfig()
{
Title = "Title",
ContentEl = "my-div"
};
Notification.Show(cfg);
}
</script>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<div id="my-div" class="x-hidden">
<ext:Button runat="server" Text="Click me">
<Listeners>
<Click Handler="alert('Hello World!');" />
</Listeners>
</ext:Button>
</div>
</form>
</body>
</html>

supera
Feb 20, 2012, 4:46 PM
Hi Daniil...

Thanks a lot for your help!

I canīt check if this example works, because I get this error:

Run time error: The object donīt support this property or method 'removeClass'.

In another Thread, you told me to wait the DP2.

Daniil
Feb 20, 2012, 5:10 PM
Yes, unfortunately, this won't work with DP1. Therefore I wrote:

The following example will work with the next release.

supera
Feb 20, 2012, 5:45 PM
Ops!

Sorry about this!

Daniil
Feb 20, 2012, 5:50 PM
No problem!