PDA

View Full Version : [CLOSED] How to show notification in parent but align to child's element?



xeo4.it
Jun 12, 2014, 5:27 PM
Hello,
in my following example I have a notification that appears into child's frame and so it is cut.
I need that the notification comes in front.
Please help me.

Thank you

Jimmy


Page1 - child


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


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


<!DOCTYPE html>

<html>
<head runat="server">
<title></title>

<script type="text/javascript">


var stub = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ...";


var btn_click = function () {


Ext.net.Notification.show({
hideFx: {
args: ['t', {}],
fxName: 'ghost'
},
showFx: {
args: ['t', {}],
fxName: 'slideIn'
},
pinEvent: 'click',
alignToCfg: {
offset: [10, 10],
position: 'tr-br',
el: Ext.net.getEl('btn')
},
html: stub,
title: 'Title'
});


}


</script>


</head>
<body>
<form runat="server">


<ext:ResourceManager runat="server" />

<ext:Button ID="btn" runat="server" Text="notif" >


<Listeners>
<Click Handler="btn_click();" />
</Listeners>


</ext:Button>


</form>
</body>
</html>


parent


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


<%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>


<!DOCTYPE html>


<html>
<head runat="server">
<title></title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />


<ext:Window
runat="server"
Title="Parent"
Width="400"
Height="200"
Layout="HBoxLayout">
<LayoutConfig>
<ext:HBoxLayoutConfig Align="Stretch" />
</LayoutConfig>
<Items>
<ext:Panel
ID="Panel1"
runat="server"
Title="AAAA"
BodyPadding="10"
Flex="1">
<Loader
runat="server"
Url="page1.aspx"
Mode="Frame">
<LoadMask ShowMask="true" />
</Loader>
</ext:Panel>
</Items>
</ext:Window>
</form>
</body>
</html>

Daniil
Jun 13, 2014, 9:03 AM
Hi Jimmy,

Here is a solution to the problem.
http://forums.ext.net/showthread.php?9935&p=165931&viewfull=1#post165931

Though you can use this:

el: Ext.net.getEl('btn')

The problem is that a parent page and a child page are individual pages.

xeo4.it
Jun 13, 2014, 9:47 AM
Hi Daniil,
I have tested your suggestion but I need that the notification shows near the button, but if I leave "el: Ext.net.getEl('btn')", I take an error.
I know that the problem is they are individual pages, I need a method to show a notification near the button.
Thank you



var btn_click = function () {


parent.Ext.net.Notification.show({
hideFx: {
args: ['t', {}],
fxName: 'ghost'
},
showFx: {
args: ['t', {}],
fxName: 'slideIn'
},
pinEvent: 'click',
alignToCfg: {
offset: [10, 10],
position: 'tr-br',
el: Ext.net.getEl('btn')
},
html: stub,
title: 'Title',
renderTo: parent.Ext.getBody()
});


}

Daniil
Jun 13, 2014, 9:56 AM
Well, you could try to calculate a Button's coordinates. Sure, the coordinates with respect to the parent page.