View Full Version : Layer Example
tprscott
27 Aug 2007, 11:25 AM
I am new to ext. I was wondering if someone could show me how to use the layers. I want to have a dive with multiple layers and I am not sure where to start. Any help would be appreciated. Thanks.
jack.slocum
27 Aug 2007, 11:58 AM
Many of the internal Ext components use layers. They make for good examples.
tprscott
27 Aug 2007, 12:09 PM
Would you be able to code up a simple example. I have spent some time looking through the documentation and I still can not figure it out. Thanks.
jack.slocum
27 Aug 2007, 1:02 PM
Take a look at QuickTips. It is pretty simple. There really isn't much to basic usage of a layer. It works similar to a standard element.
aconran
27 Aug 2007, 8:23 PM
I ripped this off of a login component I wrote a while back...
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Layer Example</title>
<link rel="stylesheet" type="text/css" href="ext/resources/css/ext-all.css" />
<script type="text/javascript" src="ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="ext/ext-all.js"></script>
<script>
Ext.onReady(function() {
var failureLayer = new Ext.Layer({
shadow:"sides",
shim: true,
constrain: true,
shadowOffset: 8
});
failureLayer.update('<div><br/><h3>Login failed<h3><p>Please provide valid credentials.</p></div>');
failureLayer.center();
failureLayer.show();
})
</script>
<body>
<p>
<h3 id="title">What is Lorem Ipsum?</h3>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Why do we use it?
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).
</p>
</body>
</html>
Aaron
tprscott
28 Aug 2007, 3:01 AM
Thanks guys
Howdy,
Using 4.06, I created a new layer based on the example and I just see text.
var failureLayer = new Ext.Layer({
shadow:"sides",
shim: true,
constrain: true,
shadowOffset: 8
});
Ext.onReady(function() {
failureLayer.update('<div><br/><h3>Login failed<h3><p>Please provide valid credentials.</p></div>');
failureLayer.center();
failureLayer.show();
});
I send the created object to the console with surprising results:
Ext.Class.newClass
constrain: true
dom: HTMLDivElement
id: "ext-gen1014"
lastShadowOffset: 8
shadow: Ext.Class.newClass
shadowDisabled: true
shadowOffset: 0
useShim: false
__proto__: Class.registerPreprocessor.prototype
Looks like the configuration options aren't being inherited by the shadow element.
shadowDisabled: true
shadowOffset: 0
useShim: false
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.