~cdparra/gelee/trunk

« back to all changes in this revision

Viewing changes to webui/ecosystem/workspace/extjs/docs/source/AbsoluteLayout.html

  • Committer: parra
  • Date: 2010-03-15 15:56:56 UTC
  • Revision ID: svn-v4:ac5bba68-f036-4e09-846e-8f32731cc928:trunk/gelee:1448
merged gelee at svn

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<html>
 
2
<head>
 
3
  <title>The source code</title>
 
4
    <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
 
5
    <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
 
6
</head>
 
7
<body  onload="prettyPrint();">
 
8
    <pre class="prettyprint lang-js"><div id="cls-Ext.layout.AbsoluteLayout"></div>/**
 
9
 * @class Ext.layout.AbsoluteLayout
 
10
 * @extends Ext.layout.AnchorLayout
 
11
 * <p>This is a layout that inherits the anchoring of <b>{@link Ext.layout.AnchorLayout}</b> and adds the
 
12
 * ability for x/y positioning using the standard x and y component config options.</p>
 
13
 * <p>This class is intended to be extended or created via the <tt><b>{@link Ext.Container#layout layout}</b></tt>
 
14
 * configuration property.  See <tt><b>{@link Ext.Container#layout}</b></tt> for additional details.</p>
 
15
 * <p>Example usage:</p>
 
16
 * <pre><code>
 
17
var form = new Ext.form.FormPanel({
 
18
    title: 'Absolute Layout',
 
19
    layout:'absolute',
 
20
    layoutConfig: {
 
21
        // layout-specific configs go here
 
22
        extraCls: 'x-abs-layout-item',
 
23
    },
 
24
    baseCls: 'x-plain',
 
25
    url:'save-form.php',
 
26
    defaultType: 'textfield',
 
27
    items: [{
 
28
        x: 0,
 
29
        y: 5,
 
30
        xtype:'label',
 
31
        text: 'Send To:'
 
32
    },{
 
33
        x: 60,
 
34
        y: 0,
 
35
        name: 'to',
 
36
        anchor:'100%'  // anchor width by percentage
 
37
    },{
 
38
        x: 0,
 
39
        y: 35,
 
40
        xtype:'label',
 
41
        text: 'Subject:'
 
42
    },{
 
43
        x: 60,
 
44
        y: 30,
 
45
        name: 'subject',
 
46
        anchor: '100%'  // anchor width by percentage
 
47
    },{
 
48
        x:0,
 
49
        y: 60,
 
50
        xtype: 'textarea',
 
51
        name: 'msg',
 
52
        anchor: '100% 100%'  // anchor width and height
 
53
    }]
 
54
});
 
55
</code></pre>
 
56
 */
 
57
Ext.layout.AbsoluteLayout = Ext.extend(Ext.layout.AnchorLayout, {
 
58
 
 
59
    extraCls: 'x-abs-layout-item',
 
60
 
 
61
    onLayout : function(ct, target){
 
62
        target.position();
 
63
        this.paddingLeft = target.getPadding('l');
 
64
        this.paddingTop = target.getPadding('t');
 
65
 
 
66
        Ext.layout.AbsoluteLayout.superclass.onLayout.call(this, ct, target);
 
67
    },
 
68
 
 
69
    // private
 
70
    adjustWidthAnchor : function(value, comp){
 
71
        return value ? value - comp.getPosition(true)[0] + this.paddingLeft : value;
 
72
    },
 
73
 
 
74
    // private
 
75
    adjustHeightAnchor : function(value, comp){
 
76
        return  value ? value - comp.getPosition(true)[1] + this.paddingTop : value;
 
77
    }
 
78
    <div id="prop-Ext.layout.AbsoluteLayout-activeItem"></div>/**
 
79
     * @property activeItem
 
80
     * @hide
 
81
     */
 
82
});
 
83
Ext.Container.LAYOUTS['absolute'] = Ext.layout.AbsoluteLayout;
 
84
</pre>    
 
85
</body>
 
86
</html>
 
 
b'\\ No newline at end of file'