diff --git a/src/core/Util.mjs b/src/core/Util.mjs index 1f84d8603..0464525ae 100644 --- a/src/core/Util.mjs +++ b/src/core/Util.mjs @@ -178,6 +178,15 @@ class Util extends Base { return value?.constructor?.name === 'Object' || false } + /** + * Returns true if the passed value is a neo data record + * @param {Object} value The value to test + * @returns {Boolean} + */ + static isRecord(value) { + return value?.constructor?.name === 'Record' || false + } + /** * Returns true if the passed value is a string * @param {String} value The value to test @@ -224,6 +233,7 @@ Neo.applyFromNs(Neo, Util, { isFunction : 'isFunction', isNumber : 'isNumber', isObject : 'isObject', + isRecord : 'isRecord', isString : 'isString', toArray : 'toArray' }, true); diff --git a/src/form/field/ComboBox.mjs b/src/form/field/ComboBox.mjs index 3e05f4193..a5a9c94ab 100644 --- a/src/form/field/ComboBox.mjs +++ b/src/form/field/ComboBox.mjs @@ -306,7 +306,7 @@ class ComboBox extends Picker { record; // getting a record, nothing to do - if (Neo.isObject(value)) { + if (Neo.isRecord(value)) { return value } @@ -687,7 +687,7 @@ class ComboBox extends Picker { updateInputValueFromValue(value) { let inputValue = null; - if (Neo.isObject(value)) { + if (Neo.isRecord(value)) { inputValue = value[this.displayField] }