Search code examples
extjsgridcellextjs4.2renderer

How to set default column renderer by column type in ExtJS?


I've a grid in ExtJS 4.2 and I need to set default renderer for its columns by type. It means that I've a renderer function for each grid column type (a renderer for Boolean columns, another for Date columns, another for Number columns, etc) and I want to change default renderer by column type globally (I can't set it individually for each grid column because I can't change legacy code).
Any idea?


Solution

  • use this override for boolean column and same this code for other column type :

    Ext.define('MyBooleanColumn',{
        override: 'Ext.grid.column.Boolean',
        renderer:function(v){
           // write your own customization code here
           return v;
        }
    });