Best way to override updater globally?
Posted on November 23rd, 2008 by admin
I know how to tell individual panels to do it, via the getUpdater()->setRenderer() method, but what about globally for ALL panels that could be instantiated?
I could just use JS to directly override the Updater prototype's getRenderer() method, but it seems like there is probably a more Ext-friendly approach.
I appreciate all feedback :)
Anyways added it and put in some documentation.
@y0y - You would override your own custom renderer like this:
Ext.Updater.override({
getDefaultRenderer: function() {
return MyCustomRenderer;
}
});
As of Ext 2.1 there is no easy way to do this because Ext instantiates an instance of Ext.Updater.BasicRenderer in its constructor.
Like this:
this.renderer = new Ext.Updater.BasicRenderer();
I've moved created a new property on the prototype of Ext.Updater called DefaultRenderer and defaulted it to the BasicRenderer.
This way in current SVN (and in the next release) you could override the default renderer for all Updaters like so:
Ext.Updater.prototype.DefaultRenderer = MyCustomRender;
might be better to change it to
if(!this.renderer){
this.renderer = this.getDefaultRenderer();
}
and
getDefaultRenderer: function() {
return new Ext.Updater.BasicRenderer();
}
..now if the procurement department would just hurry up and get me that ExtJS subscription so I can get SVN access... ;)