📄 ext.layout.anchorlayout.html
字号:
<!--Mock<link rel="stylesheet" type="text/css" href="http://localhost/ext/resources/css/ext-all.css" /><link rel="stylesheet" type="text/css" href="http://localhost/ext/doc/resources/docs.css"/><link rel="stylesheet" type="text/css" href="http://localhost/ext/doc/resources/style.css"/>--><style type="text/css"> body { overflow: scroll; } /** .mdesc .long { display: block; } */</style><!-- End Mock--><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><div class="body-wrap"> <div class="top-tools"> <a class="inner-link" href="#Ext.layout.AnchorLayout-props"><img src="/images/s.gif" class="item-icon icon-prop">Properties</a><a class="inner-link" href="#Ext.layout.AnchorLayout-methods"><img src="/images/s.gif" class="item-icon icon-method">Methods</a><a class="inner-link" href="#Ext.layout.AnchorLayout-events"><img src="/images/s.gif" class="item-icon icon-event">Events</a><a class="inner-link" href="#Ext.layout.AnchorLayout-configs"><img src="/images/s.gif" class="item-icon icon-config">Config Options</a><a class="bookmark" href="../docs/?class=Ext.layout.AnchorLayout"><img src="/images/s.gif" class="item-icon icon-fav">Direct Link</a> </div><h1>Class Ext.layout.AnchorLayout</h1> <table cellspacing="0"> <!-- <tr> <td class="label"> Package: </td> <td class="hd-info"> </td> </tr> --> <tr> <td class="label"> Defined In: </td> <td class="hd-info"> AnchorLayout.js </td> </tr> <tr> <td class="label"> Class: </td> <td class="hd-info"> Ext.layout.AnchorLayout </td> </tr> <tr> <td class="label"> Extends: </td> <td class="hd-info"> Ext.layout.ContainerLayout </td> </tr> </table> <div class="description"> <p>
相对于容器四周的尺寸大小,对其包含在内的元素进行定位式(Anchoring)的布局。
如果容器大小发生变化,所有已固定的项都会随着定位规则而变化(按照规则自动渲染)。
应通过继承此类或设置<a href="###" onClick="alert('Ext.Container#layout');">Ext.Container#layout</a>的配置layout:'anchor' 的方式创建,一般很少通过关键字new直接使用。</p>
<p>AnchorLayout不存在任何直接的配置项(other than inherited ones).
不过使用这种AnchorLayot的布局就可使用针对该布局的<b>anchorSize</b>配置项属性进行设置。
缺省下,AnchorLayout会基于其自身容器的大小来计算出定位的尺寸数值,但若指定了achorSize的值,AnchorLayout就会
按照该尺寸生成一个虚拟的容器,在这个虚拟容器上计算出定位尺寸,使得定位逻辑和父容器相分离,可实现独立调节大小</p>
<p>AnchorLayout的子项都支持<b>anchorSize</b>的配置项属性,这是一个字符串,包含两种值:水平定位值和垂直定位值(例如,'100% 50%')。
这个值便是告知子项应该怎么在容器内定位。
可使用的定位值有下列类型:
<ul>
<li><b>Percentage</b>: 1到100的任意百分比值。第一个值是容器作用下子项的宽度百分比,第二个值是高度。例如'100% 50%'就是生成完整的宽度和一半高度的子项。
如果指定的是单独的值就意味着高度和宽度都是这个值。</li>
<li><b>Offsets</b>:任意整数值,可为正数或负数。
第一个值是相当于容器右边缘的便宜值,第二个是相当于底部边缘的偏移值。例如'-50 -100'即表示生成的容器在宽度和高度分别减去50象素和100象素。
若只是指定一个值,那这个值将应用到右偏移而下偏移则缺省为0。</li>
<li><b>Sides</b>:有效的值是 'right'(或 'r')和'bottom'(或 'b')。
要么在容器上设置一个固定的值,要么在渲染时候指定好anchorSize的配置项,才能有正确的效果。</li>
</ul>
<p>可灵活设置定位的值。如'-50 75%'。</p>
</div> <div class="hr"> </div> <a id="Ext.layout.AnchorLayout-configs"></a> <h2>配置项</h2> <table cellspacing="0" class="member-table"> <tr> <th class="sig-header" colspan="2"> 配置项 </th> <th class="msource-header"> 定义者 </th> </tr> <tr class="config-row expandable"> <td class="micon"> <a class="exi" href="#expand"> </a> </td> <td class="sig"> <a id="CSS-header"></a> <b>CSS</b> : String <div class="mdesc"> <div class="short"> 一个可选添加的CSS样式类,加入到组件的容器上(默认为'')。 这为容... </div> <div class="long"> 一个可选添加的CSS样式类,加入到组件的容器上(默认为'')。 这为容器或容器的子节点加入标准CSS规则提供了方便。 </div> </div> </td> <td class="msource"> <!--如果这不是同个namespace下--> <a ext:cls="Ext.layout.ContainerLayout" ext:member="#method-CSS" href="output/Ext.layout.ContainerLayout.html#method-CSS"> ContainerLayout </a> </td> </tr> <tr class="config-row expandable"> <td class="micon"> <a class="exi" href="#expand"> </a> </td> <td class="sig"> <a id="renderHidden-header"></a> <b>renderHidden</b> : Boolean <div class="mdesc"> <div class="short"> True表示为在渲染时隐藏包含的每一项(缺省为false)。 </div> <div class="long"> True表示为在渲染时隐藏包含的每一项(缺省为false)。 </div> </div> </td> <td class="msource"> <!--如果这不是同个namespace下--> <a ext:cls="Ext.layout.ContainerLayout" ext:member="#method-renderHidden" href="output/Ext.layout.ContainerLayout.html#method-renderHidden"> ContainerLayout </a> </td> </tr> </table> <a id="Ext.layout.AnchorLayout-props"></a> <h2>公告属性</h2> <table cellspacing="0" class="member-table"> <tr> <th colspan="2"> 属性 </th> <th> 定义者 </th> </tr> <tr class="property-row inherited expandable"> <td class="micon"> <a class="exi" href="#expand"> </a> </td> <td class="sig"> <a id="activeItem-activeItem"></a> <b> activeItem: activeItem</b> <div class="mdesc"> <div class="short"> 一个已激活Ext.Component的引用 例如,if(myPane... </div> <div class="long"> 一个已激活<a href="###" onClick="alert('Ext.Component');">Ext.Component</a>的引用 例如,if(myPanel.layout.activeItem.id == 'item-1') { ... }。 activeItem只会作用在布局样式上。(像<a href="###" onClick="alert('Ext.layout.Accordion');">Ext.layout.Accordion</a>, <a href="###" onClick="alert('Ext.layout.CardLayout');">Ext.layout.CardLayout</a>和<a href="###" onClick="alert('Ext.layout.FitLayout');">Ext.layout.FitLayout</a>)。只读的。 Related to <a href="###" onClick="alert('Ext.Container#activeItem');">Ext.Container#activeItem</a>. </div> </div> </td> <td class="msource"> <!--如果这不是同个namespace下--><a ext:cls="Ext.layout.ContainerLayout" ext:member="#method-activeItem" href="output/Ext.layout.ContainerLayout.html#method-activeItem"> ContainerLayout </a> </td> </tr> </table> <a id="Ext.layout.AnchorLayout-methods"></a> <h2>公共方法</h2> <table cellspacing="0" class="member-table"> <tr> <th class="sig-header" colspan="2"> 方法 </th> <th class="msource-header"> 定义者 </th> </tr> </table> <a id="Ext.layout.AnchorLayout-events"></a> <a id="Ext.Ajax-events"></a> <h2>公告事件</h2> <div class="no-members"> 这个类没公共的事件。 </div> </div>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -