Ext.namespace("Ext.ux.plugins.grid");Ext.ux.plugins.grid.CellToolTips=function(b){var a;if(Ext.isArray(b)){a=b;b={}}else{a=b.cellTips}Ext.ux.plugins.grid.CellToolTips.superclass.constructor.call(this,b);if(b.tipConfig){this.tipConfig=b.tipConfig}this.cellTips=a};Ext.extend(Ext.ux.plugins.grid.CellToolTips,Ext.util.Observable,{cellTips:false,tipTpls:false,tipConfig:{},init:function(a){if(!this.cellTips){return}this.tipTpls={};Ext.each(this.cellTips,function(b){this.tipTpls[b.field]=new Ext.XTemplate(b.tpl)},this);delete (this.cellTips);a.on("render",this.onGridRender.createDelegate(this))},setFieldTpl:function(b,a){this.tipTpls[b]=Ext.isObject(a)?a:new Ext.XTemplate(a)},onGridRender:function(b){if(!this.tipTpls){return}Ext.apply(this.tipConfig,{target:b.getView().mainBody,delegate:".x-grid3-cell-inner",trackMouse:false,dismissDelay:60000,showDelay:200,renderTo:document.body});var a=new Ext.ToolTip(this.tipConfig);a.on("beforeshow",this.beforeTipShow.createDelegate(a,[this,b],true))},beforeTipShow:function(e,d,c){var f=c.getView().findCellIndex(e.triggerElement);var a=c.getColumnModel().getDataIndex(f);if(!d.tipTpls[a]){return false}var b=c.getStore().getAt(c.getView().findRowIndex(e.triggerElement));e.body.dom.innerHTML=d.tipTpls[a].apply(b.data)}});Ext.override(Ext.ToolTip,{onTargetOver:function(b){if(this.disabled||b.within(this.target.dom,true)){return}var a=b.getTarget(this.delegate);if(a){this.triggerElement=a;this.clearTimer("hide");this.targetXY=b.getXY();this.delayShow()}},onMouseMove:function(b){var a=b.getTarget(this.delegate);if(a){this.targetXY=b.getXY();if(a===this.triggerElement){if(!this.hidden&&this.trackMouse){this.setPagePosition(this.getTargetXY())}}else{this.hide();this.lastActive=new Date(0);this.onTargetOver(b)}}else{if(!this.closable&&this.isVisible()){this.hide()}}},hide:function(){this.clearTimer("dismiss");this.lastActive=new Date();delete this.triggerElement;Ext.ToolTip.superclass.hide.call(this)}});