You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
function onKeyDown(e: Dx{WidgetName}Types.KeyDownEvent) {
233
202
if (e.event.code === 'Space') {
234
-
const event = new KeyboardEvent('keydown', {
235
-
key: 'Enter',
236
-
keyCode: 13,
237
-
which: 13,
238
-
});
239
-
const target = e.event.target;
240
-
target.dispatchEvent(event);
203
+
const event = new KeyboardEvent('keydown', { key: 'Enter' });
204
+
e.event.target.dispatchEvent(event);
241
205
}
242
206
}
243
207
244
208
function App() {
245
209
return (
246
210
<{WidgetName} ...
247
-
items={itemsArray}
248
-
displayExpr="text"
211
+
dataSource={itemsArray}
249
212
acceptCustomValue={true}
250
213
onCustomItemCreating={onCustomItemCreating}
251
214
onKeyDown={onKeyDown}
252
215
/>
253
216
);
254
217
}
255
218
256
-
export default App;
257
-
258
219
---
259
220
260
-
To allows users to add custom items without updating the component [dataSource](/api-reference/10%20UI%20Components/dxSelectBox/1%20Configuration/dataSource.md'{basewidgetpath}/Configuration/#dataSource'), integrate the following **onCustomItemCreating** implementation:
221
+
To add custom items without updating the component [dataSource](/api-reference/10%20UI%20Components/dxSelectBox/1%20Configuration/dataSource.md'{basewidgetpath}/Configuration/#dataSource'), integrate the following **onCustomItemCreating** implementation:
261
222
262
223
---
263
224
@@ -270,7 +231,7 @@ To allows users to add custom items without updating the component [dataSource](
270
231
displayExpr: "Name",
271
232
acceptCustomValue: true,
272
233
onCustomItemCreating(e) {
273
-
e.customItem = { Name: e.text };
234
+
e.customItem = { text: e.text };
274
235
}
275
236
})
276
237
})
@@ -290,7 +251,7 @@ To allows users to add custom items without updating the component [dataSource](
@@ -301,7 +262,7 @@ To allows users to add custom items without updating the component [dataSource](
301
262
import { Dx{WidgetName}, type Dx{WidgetName}Types } from 'devextreme-vue/{widget-name}';
302
263
303
264
function onCustomItemCreating(e: Dx{WidgetName}Types.CustomItemCreatingEvent) {
304
-
e.customItem = { Name: e.text };
265
+
e.customItem = { text: e.text };
305
266
}
306
267
</script>
307
268
@@ -320,7 +281,7 @@ To allows users to add custom items without updating the component [dataSource](
320
281
321
282
function App() {
322
283
function onCustomItemCreating(e: {WidgetName}Types.CustomItemCreatingEvent) {
323
-
e.customItem = { Name: e.text };
284
+
e.customItem = { text: e.text };
324
285
}
325
286
326
287
return (
@@ -337,4 +298,4 @@ To allows users to add custom items without updating the component [dataSource](
337
298
---
338
299
339
300
#####See Also#####
340
-
-[Create a User-Defined Item](/concepts/05%20UI%20Components/SelectBox/15%20Create%20a%20User-Defined%20Item.md'/Documentation/Guide/UI_Components/{WidgetName}/Create_a_User-Defined_Item/')
301
+
-[Create a User-Defined Item](/concepts/05%20UI%20Components/SelectBox/15%20Create%20a%20User-Defined%20Item.md'/Documentation/Guide/UI_Components/{WidgetName}/Create_a_User-Defined_Item/')
0 commit comments