2013-07-11 56 views
2

我使用這個代碼在網格渲染事件顯示TPL上排鼠標懸停顯示行提示懸停

grid.tip = new Ext.ToolTip({ 
    view: grid.getView(), 
    target: grid.getView().mainBody, 
    delegate: '.x-grid3-row', 
    trackMouse: true, 
    renderTo: Ext.getBody(), 
    showDelay: 1000, 
    listeners: { 
     beforeshow: function updateTipBody(tip) { 
      var i = grid.getView().findRowIndex(tip.triggerElement); 
      var ViewObj = grid.getStore().getAt(i); 
      var nameVar, addressVar, salesOrgVar; 
      if (ViewObj.get('ERROR_MESSAGE') != null && (ViewObj.get('ERROR_MESSAGE')).length > 1) { 

       console.log("done.."); 
       nameVar = (ViewObj.get('ERROR_MESSAGE') != null && ViewObj.get('ERROR_MESSAGE') != "") ? (Ext.BUNDLE.getMsg('POSFilesWidget.ErrorFolderGrid.ErrorFolder.label') + " : " + ViewObj.get('ERROR_MESSAGE')) : ""; 
       tip.update(nameVar); 
      } else { 
       tip.setSize(0, 0); 
       tip.setVisible(false); 
       console.log("1.."); 
      } 
     } 
    } 
}); 

但是當不來的消息則顯示我的空白第三方物流,但我不想顯示工具提示請參閱圖像

enter image description here

回答

2

這是一個ExtJS bug。你必須致電

Tooltip.render(Ext.getBody()); 

在你的應用程序的開始。然後在你的聽衆

return false; 

當你不想顯示工具提示。