欢迎来到Heck's Blog,专业承接拿站、企业建站、仿站、网上商城架构、门户网站搭建、空间域名注册、软件定制等项目。关注网络安全,因为专注,所以专业,懂得放弃,才能收获。有事请发邮件至i@heckjj.com,请记住本站网址:http://www.heckjj.com,多谢。
9月2
在ext中的那个desktop的demo图标不能自动换行的,我们需要在desktop.js中加入自动换行的代码。下面看代码
//shortcuts 自动换行
var btnHeight = 61;
var btnWidth = 64;
var btnPadding = 15;
var col = null;
var row = null;
function initColRow(){
col = {index: 1, x: btnPadding};
row = {index: 1, y: btnPadding};
}
initColRow();
function isOverflow(y){
if(y > (Ext.lib.Dom.getViewHeight() – taskbarEl.getHeight())){
return true;
}
return false;
}
this.setXY = function(item){
var bottom = row.y + btnHeight,
overflow = isOverflow(row.y + btnHeight);
if(overflow && bottom > (btnHeight + btnPadding)){
col = {
index: col.index++
, x: col.x + btnWidth + btnPadding
};
row = {
index: 1
, y: btnPadding
};
}
//shortcuts 自动换行
var btnHeight = 61;
var btnWidth = 64;
var btnPadding = 15;
var col = null;
var row = null;
function initColRow(){
col = {index: 1, x: btnPadding};
row = {index: 1, y: btnPadding};
}
initColRow();
function isOverflow(y){
if(y > (Ext.lib.Dom.getViewHeight() – taskbarEl.getHeight())){
return true;
}
return false;
}
this.setXY = function(item){
var bottom = row.y + btnHeight,
overflow = isOverflow(row.y + btnHeight);
if(overflow && bottom > (btnHeight + btnPadding)){
col = {
index: col.index++
, x: col.x + btnWidth + btnPadding
};
row = {
index: 1
, y: btnPadding
};
}





