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