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
};
}
Ext.fly(item).setXY([
col.x
, row.y
]);
row.index++;
row.y = row.y + btnHeight + btnPadding;
};
this.handleUpdate = function(){
initColRow();
//var items=shortcuts.dom.children;
var items=Ext.query(“dt”,shortcuts.dom);
for(var i = 0, len = items.length; i < len; i++){
this.setXY(items[i]);
}
}
this.handleUpdate();
Ext.EventManager.onWindowResize(this.handleUpdate, this, {delay:500});
//end shortcuts 自动换行
来源:Heck's Blog
地址:https://www.heckjj.com/extjs-desktop-ico-auto-wrap/
转载时须以链接形式注明作者和原始出处及本声明,否则将追究法律责任,谢谢配合!
//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
};
}
Ext.fly(item).setXY([
col.x
, row.y
]);
row.index++;
row.y = row.y + btnHeight + btnPadding;
};
this.handleUpdate = function(){
initColRow();
//var items=shortcuts.dom.children;
var items=Ext.query(“dt”,shortcuts.dom);
for(var i = 0, len = items.length; i < len; i++){
this.setXY(items[i]);
}
}
this.handleUpdate();
Ext.EventManager.onWindowResize(this.handleUpdate, this, {delay:500});
//end shortcuts 自动换行
来源:Heck's Blog
地址:https://www.heckjj.com/extjs-desktop-ico-auto-wrap/
转载时须以链接形式注明作者和原始出处及本声明,否则将追究法律责任,谢谢配合!
网页中通过协议实现调用e
eclipse Open



