3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4 <title>The source code</title>
5 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
6 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
8 <body onload="prettyPrint();">
9 <pre class="prettyprint lang-js">/*!
10 * Ext JS Library 3.2.1
11 * Copyright(c) 2006-2010 Ext JS, Inc.
13 * http://www.extjs.com/license
15 <div id="cls-Ext.layout.AbsoluteLayout"></div>/**
16 * @class Ext.layout.AbsoluteLayout
17 * @extends Ext.layout.AnchorLayout
18 * <p>This is a layout that inherits the anchoring of <b>{@link Ext.layout.AnchorLayout}</b> and adds the
19 * ability for x/y positioning using the standard x and y component config options.</p>
20 * <p>This class is intended to be extended or created via the <tt><b>{@link Ext.Container#layout layout}</b></tt>
21 * configuration property. See <tt><b>{@link Ext.Container#layout}</b></tt> for additional details.</p>
22 * <p>Example usage:</p>
24 var form = new Ext.form.FormPanel({
25 title: 'Absolute Layout',
28 // layout-specific configs go here
29 extraCls: 'x-abs-layout-item',
33 defaultType: 'textfield',
43 anchor:'100%' // anchor width by percentage
53 anchor: '100%' // anchor width by percentage
59 anchor: '100% 100%' // anchor width and height
64 Ext.layout.AbsoluteLayout = Ext.extend(Ext.layout.AnchorLayout, {
66 extraCls: 'x-abs-layout-item',
70 onLayout : function(ct, target){
72 this.paddingLeft = target.getPadding('l');
73 this.paddingTop = target.getPadding('t');
74 Ext.layout.AbsoluteLayout.superclass.onLayout.call(this, ct, target);
78 adjustWidthAnchor : function(value, comp){
79 return value ? value - comp.getPosition(true)[0] + this.paddingLeft : value;
83 adjustHeightAnchor : function(value, comp){
84 return value ? value - comp.getPosition(true)[1] + this.paddingTop : value;
86 <div id="prop-Ext.layout.AbsoluteLayout-activeItem"></div>/**
87 * @property activeItem
91 Ext.Container.LAYOUTS['absolute'] = Ext.layout.AbsoluteLayout;