zoukankan
html css js c++ java
Ext架构分析(5)Layout初识:ContainerLayout
如果学习了Container,你回发现,在Ext2.0中,Container和Layout的关系是密不可分的。任何Container都需要在render方法中使用layout对象进行布局。
让我们先看一下所有layout的父类:ContainerLayout。
实际上,对容器及其item的渲染都是在layout对象的layout方法中实现的。而layout方法是在resize事件中触发的,基于性能的考虑,可以通过配置bufferResize属性实现延迟layout:
onResize:
function
()
{
if
(
this
.container.collapsed)
{
return
;
}
var
b
=
this
.container.bufferResize;
if
(b)
{
if
(
!
this
.resizeTask)
{
this
.resizeTask
=
new
Ext.util.DelayedTask(
this
.layout,
this
);
this
.resizeBuffer
=
typeof
b
==
'
number
'
?
b :
100
;
}
this
.resizeTask.delay(
this
.resizeBuffer);
}
else
{
this
.layout();
}
}
lyout方法会遍历所有的Container子元素并对其进行render:
renderItem :
function
(c, position, target)
{
if
(c
&&
!
c.rendered)
{
c.render(target, position);
if
(
this
.extraCls)
{
var
t
=
c.getPositionEl
?
c.getPositionEl() : c;
t.addClass(
this
.extraCls);
}
if
(
this
.renderHidden
&&
c
!=
this
.activeItem)
{
c.hide();
}
}
else
if
(c
&&
!
this
.isValidParent(c, target))
{
if
(
this
.extraCls)
{
c.addClass(
this
.extraCls);
}
if
(
typeof
position
==
'
number
'
)
{
position
=
target.dom.childNodes[position];
}
target.dom.insertBefore(c.getEl().dom, position
||
null
);
if
(
this
.renderHidden
&&
c
!=
this
.activeItem)
{
c.hide();
}
}
}
查看全文
相关阅读:
asp.net如何实现删除文件的操作? (转)
开始计算机英语的学习,先把这里当生词本用了。
CSS Box Model 盒子模型
生成网站快捷方式
Microsoft .NET Framework 3.5 sp1离线安装解决方案
asp.net生成网站快捷方式
https://mail.google.com/tasks/ig?pli=1
Sql server DATEDIFF DATEADD
局域网 跨数据库 访问数据库
asp.net 生成网站快捷方式
原文地址:https://www.cnblogs.com/meetrice/p/1206120.html
最新文章
WordPress 显示文章摘要:the_excerpt标签函数
使用PHPLIB进行Session的管理和认证(转载)
php引用(&)详解
jquery 动态事件
php memcached 安装小记
[转]经验之谈:10位顶级PHP大师的开发原则
js兼容多浏览器的复制链接地址
判断WebSERVER类型
asp.net开发网站时指定或截取标题字数的方法和内容页多关键字切分的方法
webconfig相关
热门文章
asp.net开发的网站中使用mysql
在服务器端控件中添加客户端属性
计算机英语5
计算机英语2
你必须知道的.net中把new说透中答案
asp.net生成静态页面的一个方法
计算机英语3
asp.net C# 时间格式大全
计算机英语4
读写ini文件代码
Copyright © 2011-2022 走看看