~crf-team/crf-irp/crf-irp

« back to all changes in this revision

Viewing changes to WebContent/js/extjs-2/docs/output/ContainerLayout.jss.html

  • Committer: Thomas
  • Date: 2010-03-10 23:55:46 UTC
  • Revision ID: thomas@daisybox-port-20100310235546-23635dk6x5asb1ca
Upgrade ExtJs 3.1.1
Upgrade Spring 3.0.1 + dependencies
Change Jawr JS post processor : YUI
Upgrade to last build of dwr 3 trunk 69 revision 3019(after build 116), upgrade jawr-dwr plugin 1.4 unofficiale from jose noheda, Jawr 3.2.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<html><head><title>ContainerLayout.js</title><link rel="stylesheet" type="text/css" href="../resources/style.css" media="screen"/></head><body><h1>ContainerLayout.js</h1><pre class="highlighted"><code><i>/**
2
 
 * @class Ext.layout.ContainerLayout
3
 
 * &lt;p&gt;Every {@link Ext.Container Container} delegates the rendering of its child {@link Ext.Component Component}s
4
 
 * to a layout manager class which must be {@link Ext.Container#layout configured} into the Container.&lt;/p&gt;
5
 
 * &lt;p&gt;Some layouts also provide sizing and positioning of child Components.&lt;/p&gt;
6
 
 * &lt;p&gt;The ContainerLayout class is the <b>default</b> layout manager used when no layout is configured into a Container.
7
 
 * It provides the basic foundation <b>for</b> all other layout classes <b>in</b> Ext. It simply renders all child Components
8
 
 * into the Container, performing no sizing or positioning services.&lt;/p&gt;
9
 
 * &lt;p&gt;This class is intended to be extended and should generally not need to be created directly via the <b>new</b> keyword.&lt;/p&gt;
10
 
 */</i>
11
 
Ext.layout.ContainerLayout = <b>function</b>(config){
12
 
    Ext.apply(<b>this</b>, config);
13
 
};
14
 
 
15
 
Ext.layout.ContainerLayout.prototype = {
16
 
    <i>/**
17
 
     * @cfg {String} extraCls
18
 
     * An optional extra CSS class that will be added to the container (defaults to <em>''</em>).  This can be useful <b>for</b>
19
 
     * adding customized styles to the container or any of its children using standard CSS rules.
20
 
     */</i>
21
 
<i>// holder</i>
22
 
<i>/***
23
 
     * @cfg {Boolean} renderHidden
24
 
     * True to hide each contained item on render (defaults to false).
25
 
     */</i>
26
 
<i>// holder</i>
27
 
<i>/***
28
 
     * A reference to the {@link Ext.Component} that is active.  For example,
29
 
     * <b>if</b>(myPanel.layout.activeItem.id == <em>'item-1'</em>) { ... }.  activeItem only applies to layout styles that can
30
 
     * display items one at a time (like {@link Ext.layout.Accordion}, {@link Ext.layout.CardLayout}
31
 
     * and {@link Ext.layout.FitLayout}).  Read-only.  Related to {@link Ext.Container#activeItem}.
32
 
     * @type {Ext.Component}
33
 
     * @property activeItem
34
 
     */</i>
35
 
 
36
 
    <i>// private</i>
37
 
    monitorResize:false,
38
 
    <i>// private</i>
39
 
    activeItem : null,
40
 
 
41
 
    <i>// private</i>
42
 
    layout : <b>function</b>(){
43
 
        <b>var</b> target = <b>this</b>.container.getLayoutTarget();
44
 
        <b>this</b>.onLayout(<b>this</b>.container, target);
45
 
        <b>this</b>.container.fireEvent(<em>'afterlayout'</em>, <b>this</b>.container, <b>this</b>);
46
 
    },
47
 
 
48
 
    <i>// private</i>
49
 
    onLayout : <b>function</b>(ct, target){
50
 
        <b>this</b>.renderAll(ct, target);
51
 
    },
52
 
 
53
 
    <i>// private</i>
54
 
    isValidParent : <b>function</b>(c, target){
55
 
                <b>var</b> el = c.getPositionEl ? c.getPositionEl() : c.getEl();
56
 
                <b>return</b> el.dom.parentNode == target.dom;
57
 
    },
58
 
 
59
 
    <i>// private</i>
60
 
    renderAll : <b>function</b>(ct, target){
61
 
        <b>var</b> items = ct.items.items;
62
 
        <b>for</b>(var i = 0, len = items.length; i &lt; len; i++) {
63
 
            <b>var</b> c = items[i];
64
 
            <b>if</b>(c &amp;&amp; (!c.rendered || !<b>this</b>.isValidParent(c, target))){
65
 
                <b>this</b>.renderItem(c, i, target);
66
 
            }
67
 
        }
68
 
    },
69
 
 
70
 
    <i>// private</i>
71
 
    renderItem : <b>function</b>(c, position, target){
72
 
        <b>if</b>(c &amp;&amp; !c.rendered){
73
 
            c.render(target, position);
74
 
            <b>if</b>(this.extraCls){
75
 
                <b>var</b> t = c.getPositionEl ? c.getPositionEl() : c;
76
 
                t.addClass(<b>this</b>.extraCls);
77
 
            }
78
 
            <b>if</b> (<b>this</b>.renderHidden &amp;&amp; c != <b>this</b>.activeItem) {
79
 
                c.hide();
80
 
            }
81
 
        }<b>else</b> if(c &amp;&amp; !<b>this</b>.isValidParent(c, target)){
82
 
            <b>if</b>(this.extraCls){
83
 
                <b>var</b> t = c.getPositionEl ? c.getPositionEl() : c;
84
 
                t.addClass(<b>this</b>.extraCls);
85
 
            }
86
 
            <b>if</b>(typeof position == <em>'number'</em>){
87
 
                position = target.dom.childNodes[position];
88
 
            }
89
 
            target.dom.insertBefore(c.getEl().dom, position || null);
90
 
            <b>if</b> (<b>this</b>.renderHidden &amp;&amp; c != <b>this</b>.activeItem) {
91
 
                c.hide();
92
 
            }
93
 
        }
94
 
    },
95
 
 
96
 
    <i>// private</i>
97
 
    onResize: <b>function</b>(){
98
 
        <b>if</b>(this.container.collapsed){
99
 
            <b>return</b>;
100
 
        }
101
 
        <b>var</b> b = <b>this</b>.container.bufferResize;
102
 
        <b>if</b>(b){
103
 
            <b>if</b>(!<b>this</b>.resizeTask){
104
 
                <b>this</b>.resizeTask = <b>new</b> Ext.util.DelayedTask(<b>this</b>.layout, <b>this</b>);
105
 
                <b>this</b>.resizeBuffer = <b>typeof</b> b == <em>'number'</em> ? b : 100;
106
 
            }
107
 
            <b>this</b>.resizeTask.delay(<b>this</b>.resizeBuffer);
108
 
        }<b>else</b>{
109
 
            <b>this</b>.layout();
110
 
        }
111
 
    },
112
 
 
113
 
    <i>// private</i>
114
 
    setContainer : <b>function</b>(ct){
115
 
        <b>if</b>(this.monitorResize &amp;&amp; ct != <b>this</b>.container){
116
 
            <b>if</b>(this.container){
117
 
                <b>this</b>.container.un(<em>'resize'</em>, <b>this</b>.onResize, <b>this</b>);
118
 
            }
119
 
            <b>if</b>(ct){
120
 
                ct.on(<em>'resize'</em>, <b>this</b>.onResize, <b>this</b>);
121
 
            }
122
 
        }
123
 
        <b>this</b>.container = ct;
124
 
    },
125
 
 
126
 
    <i>// private</i>
127
 
    parseMargins : <b>function</b>(v){
128
 
        <b>var</b> ms = v.split(<em>' '</em>);
129
 
        <b>var</b> len = ms.length;
130
 
        <b>if</b>(len == 1){
131
 
            ms[1] = ms[0];
132
 
            ms[2] = ms[0];
133
 
            ms[3] = ms[0];
134
 
        }
135
 
        <b>if</b>(len == 2){
136
 
            ms[2] = ms[0];
137
 
            ms[3] = ms[1];
138
 
        }
139
 
        <b>return</b> {
140
 
            top:parseInt(ms[0], 10) || 0,
141
 
            right:parseInt(ms[1], 10) || 0,
142
 
            bottom:parseInt(ms[2], 10) || 0,
143
 
            left:parseInt(ms[3], 10) || 0
144
 
        };
145
 
    },
146
 
 
147
 
    <i>/*
148
 
     * Destroys <b>this</b> layout. This is a template method that is empty by <b>default</b>, but should be implemented
149
 
     * by subclasses that require explicit destruction to purge event handlers or remove DOM nodes.
150
 
     * @protected
151
 
     */</i>
152
 
    destroy : Ext.emptyFn
153
 
};
154
 
Ext.Container.LAYOUTS[<em>'auto'</em>] = Ext.layout.ContainerLayout;</code></pre><hr><div style="font-size:10px;text-align:center;color:gray;">Ext - Copyright &copy; 2006-2007 Ext JS, LLC<br />All rights reserved.</div>
155
 
    </body></html>
 
 
b'\\ No newline at end of file'