3 * Copyright(c) 2006-2009 Ext JS, LLC
5 * http://www.extjs.com/license
8 * @class Ext.layout.AbsoluteLayout
\r
9 * @extends Ext.layout.AnchorLayout
\r
10 * <p>This is a layout that inherits the anchoring of <b>{@link Ext.layout.AnchorLayout}</b> and adds the
\r
11 * ability for x/y positioning using the standard x and y component config options.</p>
\r
12 * <p>This class is intended to be extended or created via the <tt><b>{@link Ext.Container#layout layout}</b></tt>
\r
13 * configuration property. See <tt><b>{@link Ext.Container#layout}</b></tt> for additional details.</p>
\r
14 * <p>Example usage:</p>
\r
16 var form = new Ext.form.FormPanel({
\r
17 title: 'Absolute Layout',
\r
20 // layout-specific configs go here
\r
21 extraCls: 'x-abs-layout-item',
\r
24 url:'save-form.php',
\r
25 defaultType: 'textfield',
\r
35 anchor:'100%' // anchor width by percentage
\r
45 anchor: '100%' // anchor width by percentage
\r
51 anchor: '100% 100%' // anchor width and height
\r
56 Ext.layout.AbsoluteLayout = Ext.extend(Ext.layout.AnchorLayout, {
\r
58 extraCls: 'x-abs-layout-item',
\r
60 onLayout : function(ct, target){
\r
62 this.paddingLeft = target.getPadding('l');
\r
63 this.paddingTop = target.getPadding('t');
\r
65 Ext.layout.AbsoluteLayout.superclass.onLayout.call(this, ct, target);
\r
69 adjustWidthAnchor : function(value, comp){
\r
70 return value ? value - comp.getPosition(true)[0] + this.paddingLeft : value;
\r
74 adjustHeightAnchor : function(value, comp){
\r
75 return value ? value - comp.getPosition(true)[1] + this.paddingTop : value;
\r
78 * @property activeItem
\r
82 Ext.Container.LAYOUTS['absolute'] = Ext.layout.AbsoluteLayout;