This means the records parameter has the new value of the textbox as a string, and as it is not an array it is set to the record value.
As record is then always evaluates to true the printProvider.customParams[field.name] = value; is never called.
I guess a workaround could be to check if records is a string?
onFieldChange: function(field, records) {
var record;
if (Ext.isArray(records)) {
record = records[0];
} else {
record = records; // set to string of textbox
}
var printProvider = this.printProvider || field.ownerCt.printProvider;
var value = field.getValue();
this._updating = true;
if(record) {
switch(field.store) {
case printProvider.layouts:
printProvider.setLayout(record);
break;
case printProvider.dpis:
printProvider.setDpi(record);
break;
case printProvider.outputFormats:
printProvider.setOutputFormat(record);
default:
// no op
}
} else {
// never called
printProvider.customParams[field.name] = value;
}
delete this._updating;
}
In https://github.com/geoext/geoext2/blob/master/src/GeoExt/plugins/PrintProviderField.js the onFieldChange accepts 2 arguments.
When a textbox is used the change event passes in 3 arguments.
me.fireEvent('change', me, newVal, oldVal);
This means the
records
parameter has the new value of the textbox as a string, and as it is not an array it is set to the record value.As record is then always evaluates to true the
printProvider.customParams[field.name] = value;
is never called.I guess a workaround could be to check if
records
is a string?