效果图:
方式一,所有单元格都有提示:
代码:
//鼠标悬停提示
Ext.override(Ext.grid.GridPanel, {
afterRender : Ext.Function.createSequence(Ext.grid.GridPanel.prototype.afterRender,function() {
var view = this.getView();
this.tip = new Ext.ToolTip({
target: view.el,
delegate : '.x-grid-cell-inner',
trackMouse: true,
renderTo: Ext.getBody(),
style:{
backgroundColor:'#FFB800',//自定义背景色
},
listeners: {
beforeshow: function updateTipBody(tip) {
//取cell的值
//fireFox tip.triggerElement.textContent
//IE tip.triggerElement.innerText
var tipText = (tip.triggerElement.i