Animal
14 Feb 2009, 8:00 AM
In src/widgets/grid/Column.js:
Ext.grid.BooleanColumn = Ext.extend(Ext.grid.Column, {
/**
* @cfg {String} trueText
* The text used
*/
trueText: 'true',
falseText: 'false',
undefinedText: '�',
constructor: function(cfg){
this.supr().constructor.apply(this, arguments);
var t = this.trueText, f = this.falseText, u = this.undefinedText;
this.renderer = function(v){
if(v === undefined){
return u;
}
if(!v || v === 'false'){
return f;
}
return t;
};
}
});
Needs an extra section in the locale files:
if(Ext.grid.BooleanColumn){
Ext.apply(Ext.grid.BooleanColumn.prototype, {
trueText : "true",
falseText : "false"
});
}
And DateColumn should used the localized renderer which is configured into Ext.util.Format by the locale file rather than generating another renderer using 'm/d/Y'. Code should be:
Ext.grid.DateColumn = Ext.extend(Ext.grid.Column, {
constructor: function(cfg){
this.supr().constructor.apply(this, arguments);
this.renderer = Ext.util.Format.date;
}
});
Ext.grid.BooleanColumn = Ext.extend(Ext.grid.Column, {
/**
* @cfg {String} trueText
* The text used
*/
trueText: 'true',
falseText: 'false',
undefinedText: '�',
constructor: function(cfg){
this.supr().constructor.apply(this, arguments);
var t = this.trueText, f = this.falseText, u = this.undefinedText;
this.renderer = function(v){
if(v === undefined){
return u;
}
if(!v || v === 'false'){
return f;
}
return t;
};
}
});
Needs an extra section in the locale files:
if(Ext.grid.BooleanColumn){
Ext.apply(Ext.grid.BooleanColumn.prototype, {
trueText : "true",
falseText : "false"
});
}
And DateColumn should used the localized renderer which is configured into Ext.util.Format by the locale file rather than generating another renderer using 'm/d/Y'. Code should be:
Ext.grid.DateColumn = Ext.extend(Ext.grid.Column, {
constructor: function(cfg){
this.supr().constructor.apply(this, arguments);
this.renderer = Ext.util.Format.date;
}
});