This question has the answer to adding the tooltip: Extjs4 set tooltip on each column hover in gridPanel
I have a follow up question to the most upvoted answer to t
In your plugins init
method, you will be able to loop through the columns of the grid (the constructor and initComponent
methods of the grid will have already been called at this point).
That means that you can inspect each column to see if the user has setup a custom renderer. If there is none, you can put your one, and if there is one, you can chain the existing renderer with yours.
EDIT
Ext.define('My.Plugin', {
init: function(grid) {
// You may not need the scope, but if you do, this binding will
// allow to preserve the scope configured in the column...
var pluginRenderer = Ext.Function.bind(this.renderer, this);
Ext.each(grid.query('gridcolumn'), function(col) {
var renderer = col.renderer;
col.renderer = renderer
? Ext.Function.createSequence(renderer, pluginRenderer)
: pluginRenderer;
});
}
,renderer: function(value, md) {
// ...
// You must return, in case your renderer is the only one (if
// there is another one, this return will be ignored by createSequence)
return value;
}
});