Index: ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsTemplateApplicationView.js =================================================================== diff -u -r14558 -r14562 --- ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsTemplateApplicationView.js (.../goodsTemplateApplicationView.js) (revision 14558) +++ ssts-web/src/main/webapp/disinfectsystem/recyclingApplication/goodsTemplateApplicationView.js (.../goodsTemplateApplicationView.js) (revision 14562) @@ -3418,60 +3418,7 @@ } } });*/ - 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可以取到列的位置 @@ -3522,46 +3469,14 @@ tableContent += "" + content + "
"; record.set("htmlContent",tableContent); } - var rowEl = top.Ext.fly(e.getTarget());// 把target转换成Ext.Element对象 -// if(timer){ -// clearTimeout(timer); -// } - closeTableWin(); - tableWin = createTableWin(); - tableWin.show(); - - tableWin.body.dom.innerHTML = tableContent; - tableWin.setPosition(e.xy[0],e.xy[1]); +// var maxWidth = grid.getInnerWidth(); + var maxHeight = grid.getInnerHeight(); - 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); + var rowEl = top.Ext.fly(e.getTarget());// 把target转换成Ext.Element对象 + var align = e.xy[1] > maxHeight / 2 ? 'bl-tr' : 'tl-tr'; + rowEl.set({ + 'ext:qalign':align, + 'ext:qtip' : tableContent,'ext:qwidth':450,'ext:qtitle':' 申请物品列表:'},false); // /*grid.tip.show(); grid.tip.body.dom.innerHTML = tableContent;*/