We are dealing with special Date objects on server side. So json returns a object. For this we wanted to override the field definition for Ext.data.field.Date
Ext.define('Ext.overrides.data.field.Date', {
override: 'Ext.data.field.Date',
convert: function(v) {
// Do something with v and return it
console.log('Process value');
return v;
}
});
The convert method is never triggered. Configuring the field with a convert method inside of a Model works and the method is called.
We ended up with the following "hack" but are not sure why the "normal override" is not working. Maybe someone can shed some light on that issue.
Ext.define('Ext.overrides.data.field.Date', {
override: 'Ext.data.field.Date',
constructor: function(config) {
var me = this;
this.convert = config.convert || function(v) {
// Do something with v and return it
console.log('Process value');
return v;
};
this.callParent(arguments);
}
});