[SOLVED] [1.0] Layer javascript/markup Example request
New Community Forums available at http://forums.ext.net
 

Coolite Forums

Welcome Guest ( Login | Register )
 
[SOLVED] [1.0] Layer javascript/markup...
Subscribe
Last Login: 6/15/2010 7:04:56 AM
Posts: 344,
Posted 3/12/2010 12:30:02 AM

Group: Coolite Premium Member & Early Adopter
Referring to the following example on the Examples Explorer:
#/Element/Basic/Layer/

I would request an example with Layers being used/shown/hidden on the client-side in javascript. Also, can we create Layers in markup? There is no <ext:Layer> element in Intellisense.

Lastly, is it possible to use regular Ext.Net/ExtJs controls in Layers?


--
http://www.rahulsingla.com
Last Login: 7/5/2010 10:10:13 AM
Posts: 7,853,
Posted 3/12/2010 7:19:28 AM

Group: Core Development Team
Hi,

I would request an example with Layers being used/shown/hidden on the client-side in javascript.
Please see the sample below

Also, can we create Layers in markup?
No, Layer is not control

is it possible to use regular Ext.Net/ExtJs controls in Layers?
Below sample demosntrates panel in the Layer (Show bottom)


<%@ Page Language="C#" %>
<%@ Import Namespace="Panel=Ext.Net.Panel" %>
<%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>

<!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>Layer Overview - Ext.NET Examples</title>
    <link href="../../../../resources/css/examples.css" rel="stylesheet" type="text/css" /> 
   
    <style type="text/css">
        .layer {            
             width : 100px;
             height : 250px;
             padding : 5px;
             border : solid 1px silver;
        }
       
        .layer div {
            height : 238px;
            background-color : silver;
            padding : 5px;
        }
    </style>
   
    <script type="text/javascript">
        function showRight(){
            var layer = new Ext.Layer({
                id: "Layer1",
                dh: {
                    cls: "layer",
                    cn: [{
                        cn: [{
                            tag: "h3",
                            html: "Hello"
                        },
                        {
                            tag: "hr"
                        },
                        {
                            tag: "a",
                            html: "Close",
                            href: "#",
                            onClick: "closeRight(); return false;"
                        }]
                    }]
                }
            });
           
            layer.alignTo(Panel1.el, "tl-tr", [5, 0]);
            layer.slideIn("l");
            Button1.setDisabled(true);
        }
       
        function closeRight(){
            var layer = Ext.get("Layer1");

            layer.slideOut("l", {
                callback: function () {
                    layer.remove();
                }
            });
            Button1.setDisabled(false);
        }
       
        function showBottom(){
            new Ext.Panel({
                id: "Panel2",
                cls: "x-hidden",
                renderTo: Ext.getBody(),
                height: 100,
                width: 300,
                html: "Ext.Net Panel",
                padding: 5,
                title: "Panel in Layer",
                tools: [{
                    id: "close",
                    handler: closeBottom
                }]
            });
           
            var layer = new Ext.Layer({
                id: "Layer2"
            }, Panel2.el);
           
            layer.alignTo(Panel1.el, "tl-bl", [0, 5]);
            layer.slideIn("t");
            Button2.setDisabled(true);
        }
       
        function closeBottom(){
            var layer = Ext.get("Layer2");
            layer.slideOut("t", {
                callback: function () {
                    layer.remove();
                }
            });
            Button2.setDisabled(false);
        }
    </script>
</head>
<body>
    <ext:ResourceManager runat="server"/> 
   
    <ext:Panel
        ID="Panel1"
        runat="server"
        Title="Panel"
        Width="300"
        Height="300">
        <Buttons>
            <ext:Button ID="Button1" runat="server" Text="Show Right" OnClientClick="showRight();" />
           
            <ext:Button ID="Button2" runat="server" Text="Show Bottom" OnClientClick="showBottom();" />
        </Buttons>
    </ext:Panel>
</body>
</html>


--
Vladimir Shcheglov
Coolite Inc.
Development Team
Forum Guidelines | Coolite Examples | Coolite API Docs | ExtJS API Docs | Twitter
Last Login: 6/15/2010 7:04:56 AM
Posts: 344,
Posted 3/12/2010 10:23:36 PM

Group: Coolite Premium Member & Early Adopter
Hi vlad, thanx for the example. That helped, except for those cryptic abbreviations (dh, cn etc.).


--
http://www.rahulsingla.com
Last Login: 7/5/2010 10:10:13 AM
Posts: 7,853,
Posted 3/13/2010 11:05:18 AM

Group: Core Development Team
Hi,

dh - DomHelper object
http://www.extjs.com/deploy/dev/docs/source/Layer.html#cfg-Ext.Layer-dh

cn - children
An array of the same kind of element definition objects to be created and appended. These can be nested as deep as you want.
http://www.extjs.com/deploy/dev/docs/source/DomHelper-more.html#cls-Ext.DomHelper

--
Vladimir Shcheglov
Coolite Inc.
Development Team
Forum Guidelines | Coolite Examples | Coolite API Docs | ExtJS API Docs | Twitter
« Prev Topic | Next Topic »
Reading This Topic
Active Users: 0 ( 0 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.
All times are GMT -5:00, Time now is 8:34pm