Index: ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsTemplateApplicationView.js =================================================================== diff -u -r14554 -r14558 --- ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsTemplateApplicationView.js (.../goodsTemplateApplicationView.js) (revision 14554) +++ ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsTemplateApplicationView.js (.../goodsTemplateApplicationView.js) (revision 14558) @@ -3418,7 +3418,60 @@ } } });*/ + var tableWin = null; + + function createTableWin(){ + var win = new top.Ext.Window({ + border:false, + title:'申请物品列表:', + items:[{ + xtype:'panel', + id:'tableContent', + closable:false + }] + }); + return win; + } + function closeTableWin(){ + if(tableWin){ + tableWin.close(); + tableWin = null; + } + } + function adjustTableWinPosition(){ + var maxWidth=window.innerWidth + || document.documentElement.clientWidth + || document.body.clientWidth; + + var maxHeight=window.innerHeight + || document.documentElement.clientHeight + || document.body.clientHeight; +// console.log("----------------------------------------------"); + var posx = tableWin.getPosition()[0]; + var posy = tableWin.getPosition()[1]; +// console.log("posy:" + posy); + var width = tableWin.getSize().width; + var height = tableWin.getSize().height; +// console.log("width:" + width + " height:" + height); + if(posy + height > maxHeight){ + posy = maxHeight - height; + if(posy < 0){ + posy = 0; + } +// console.log("posy:" + posy); + } + if(posx + width > maxWidth){ + posx = maxWidth - width; + if(posx < 0){ + posx = 0; + } + } + tableWin.setPagePosition(posx,posy); +// console.log("----------------------------------------------"); + } + //var timer = null; + var tableContent; grid.on('mouseover', function(e) {// 添加mouseover事件 var index = grid.getView().findRowIndex(e.getTarget());// 根据mouse所在的target可以取到列的位置 @@ -3469,11 +3522,47 @@ tableContent += "" + content + "
"; record.set("htmlContent",tableContent); } - var rowEl = top.Ext.fly(e.getTarget());// 把target转换成Ext.Element对象 - rowEl.set({ - 'ext:qtip' : tableContent,'ext:qwidth':450,'ext:qtitle':' 申请物品列表:'},false); +// if(timer){ +// clearTimeout(timer); +// } + closeTableWin(); + tableWin = createTableWin(); + tableWin.show(); + + tableWin.body.dom.innerHTML = tableContent; + tableWin.setPosition(e.xy[0],e.xy[1]); + adjustTableWinPosition(); + + //timer = setTimeout('getCurrentTab().closeTableWin();',10000); + +// var qt = new Ext.QuickTip({ +// target: rowEl, +// title: 'My Tooltip', +// text: tableContent, +// width: 450, +// trackMouse: true, +// mouseOffset : [100,100], +// dismissDelay: 20000 +// }); +// +// Ext.QuickTips.register({ +// target: rowEl, +// title: 'My Tooltip', +// text: tableContent, +// width: 450, +// trackMouse: true, +// mouseOffset : [100,100], +// dismissDelay: 20000 +// }); +// new Ext.ToolTip({ +// target: rowEl, +// html: tableContent +// }); +// rowEl.set({ +// 'ext:qtip' : tableContent,'ext:qwidth':450,'ext:qtitle':' 申请物品列表:'},false); +// /*grid.tip.show(); grid.tip.body.dom.innerHTML = tableContent;*/ }else{