Hello,
I am using a ComboBoxItem as a template for a ListGridField editor and I'd like to accept new distinct values (addUnknownValues = true) but disallowing empty value (tried: allowEmptyValue = false) with the "revert to original value" semantics.
Unfortunately, by reading the docs and code (_updateValue), it seems that setting allowEmptyValue to false has no effect when addUnknownValues is true. (suppressSave is always false in this condition).
Would it make sense for you to support that?
Something like replacing the current logic:
By this (obviously I'm totaly unaware of possible collateral effects):
If not, could you suggest a different approach to achieve that behavior?
I am using a ComboBoxItem as a template for a ListGridField editor and I'd like to accept new distinct values (addUnknownValues = true) but disallowing empty value (tried: allowEmptyValue = false) with the "revert to original value" semantics.
Unfortunately, by reading the docs and code (_updateValue), it seems that setting allowEmptyValue to false has no effect when addUnknownValues is true. (suppressSave is always false in this condition).
Would it make sense for you to support that?
Something like replacing the current logic:
Code:
var suppressSave = !forceSave && !this._valuePicked && this.addUnknownValues == false;
if (suppressSave && this.allowEmptyValue && (value == "")) {
suppressSave = false;
}Code:
var suppressSave;
if (forceSave || this._valuePicked) {
suppressSave = false;
} else {
suppressSave = !this.addUnknownValues || (value == "" && !this.allowEmptyValue);
}