4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>The source code</title>
6 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
7 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
8 <style type="text/css">
9 .highlight { display: block; background-color: #ddd; }
11 <script type="text/javascript">
12 function highlight() {
13 document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
17 <body onload="prettyPrint(); highlight();">
18 <pre class="prettyprint lang-js"><span id='Ext-layout-container-Absolute'>/**
19 </span> * @class Ext.layout.container.Absolute
20 * @extends Ext.layout.container.Anchor
22 * This is a layout that inherits the anchoring of {@link Ext.layout.container.Anchor} and adds the
23 * ability for x/y positioning using the standard x and y component config options.
25 * This class is intended to be extended or created via the {@link Ext.container.Container#layout layout}
26 * configuration property. See {@link Ext.container.Container#layout} for additional details.
29 * Ext.create('Ext.form.Panel', {
30 * title: 'Absolute Layout',
35 * // layout-specific configs go here
36 * //itemCls: 'x-abs-layout-item',
38 * url:'save-form.php',
39 * defaultType: 'textfield',
49 * anchor:'90%' // anchor width by percentage
59 * anchor: '90%' // anchor width by percentage
63 * xtype: 'textareafield',
65 * anchor: '100% 100%' // anchor width and height
67 * renderTo: Ext.getBody()
70 Ext.define('Ext.layout.container.Absolute', {
72 /* Begin Definitions */
74 alias: 'layout.absolute',
75 extend: 'Ext.layout.container.Anchor',
76 alternateClassName: 'Ext.layout.AbsoluteLayout',
80 itemCls: Ext.baseCSSPrefix + 'abs-layout-item',
84 onLayout: function() {
86 target = me.getTarget(),
87 targetIsBody = target.dom === document.body;
89 // Do not set position: relative; when the absolute layout target is the body
93 me.paddingLeft = target.getPadding('l');
94 me.paddingTop = target.getPadding('t');
95 me.callParent(arguments);
99 adjustWidthAnchor: function(value, comp) {
100 //return value ? value - comp.getPosition(true)[0] + this.paddingLeft: value;
101 return value ? value - comp.getPosition(true)[0] : value;
105 adjustHeightAnchor: function(value, comp) {
106 //return value ? value - comp.getPosition(true)[1] + this.paddingTop: value;
107 return value ? value - comp.getPosition(true)[1] : value;