In modern toolkit - there isn't uncheckedValue
in checkboxfield
.
I guess you're using record.set(form.getValues());
and next store.sync()
so you can do what you said (override checkbox
or use Ext.data.writer.Writer.transform
) or you can use serialize in model.
A function which converts the Model's value for this Field into a form which can be used by whatever Ext.data.writer.Writer is being used to sync data with the server.
Example:
Ext.define('App.model.Test', {
fields: [{
name: 'status',
type: 'auto',
serialize: function (value, record) {
if(value === 1){
return "success";
} else {
return "failed";
}
}
}]
});