1 <!DOCTYPE html><html><head><title>Sencha Documentation Project</title><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../prettify.css" type="text/css"><link rel="stylesheet" href="../prettify_sa.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script></head><body onload="prettyPrint()"><pre class="prettyprint"><pre><span id='Ext-layout.container.Absolute'>/**
2 </span> * @class Ext.layout.container.Absolute
3 * @extends Ext.layout.container.Anchor
4 * <p>This is a layout that inherits the anchoring of <b>{@link Ext.layout.container.Anchor}</b> and adds the
5 * ability for x/y positioning using the standard x and y component config options.</p>
6 * <p>This class is intended to be extended or created via the <tt><b>{@link Ext.container.Container#layout layout}</b></tt>
7 * configuration property. See <tt><b>{@link Ext.container.Container#layout}</b></tt> for additional details.</p>
8 * {@img Ext.layout.container.Absolute/Ext.layout.container.Absolute.png Ext.layout.container.Absolute container layout}
9 * <p>Example usage:</p>
10 * <pre><code>
11 Ext.create('Ext.form.Panel', {
12 title: 'Absolute Layout',
17 // layout-specific configs go here
18 //itemCls: 'x-abs-layout-item',
21 defaultType: 'textfield',
31 anchor:'90%' // anchor width by percentage
41 anchor: '90%' // anchor width by percentage
45 xtype: 'textareafield',
47 anchor: '100% 100%' // anchor width and height
49 renderTo: Ext.getBody()
51 </code></pre>
54 Ext.define('Ext.layout.container.Absolute', {
56 /* Begin Definitions */
58 alias: 'layout.absolute',
59 extend: 'Ext.layout.container.Anchor',
60 requires: ['Ext.chart.axis.Axis', 'Ext.fx.Anim'],
61 alternateClassName: 'Ext.layout.AbsoluteLayout',
65 itemCls: Ext.baseCSSPrefix + 'abs-layout-item',
69 onLayout: function() {
71 target = me.getTarget(),
72 targetIsBody = target.dom === document.body;
74 // Do not set position: relative; when the absolute layout target is the body
78 me.paddingLeft = target.getPadding('l');
79 me.paddingTop = target.getPadding('t');
80 me.callParent(arguments);
84 adjustWidthAnchor: function(value, comp) {
85 //return value ? value - comp.getPosition(true)[0] + this.paddingLeft: value;
86 return value ? value - comp.getPosition(true)[0] : value;
90 adjustHeightAnchor: function(value, comp) {
91 //return value ? value - comp.getPosition(true)[1] + this.paddingTop: value;
92 return value ? value - comp.getPosition(true)[1] : value;
94 });</pre></pre></body></html>