neo.mjs 4.4.18 → 4.4.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/form/field/Select.mjs +11 -0
package/package.json
CHANGED
@@ -226,6 +226,17 @@ class Select extends Picker {
|
|
226
226
|
beforeSetStore(value, oldValue) {
|
227
227
|
oldValue?.destroy();
|
228
228
|
|
229
|
+
// to reduce boilerplate code, a store config object without a defined model should default
|
230
|
+
// to displayField & valueField defaults
|
231
|
+
if (Neo.typeOf(value) === 'Object' && !value.model) {
|
232
|
+
value.model = {
|
233
|
+
fields: [
|
234
|
+
{name: 'id', type: 'String'},
|
235
|
+
{name: 'name', type: 'String'}
|
236
|
+
]
|
237
|
+
}
|
238
|
+
}
|
239
|
+
|
229
240
|
return ClassSystemUtil.beforeSetInstance(value, Store);
|
230
241
|
}
|
231
242
|
|