Our pure JavaScript Scheduler component


Post by sachidanand »

Hello Team,

We have the following scenario (reproducible in the attached zip).

I have added a combo field (drinks) to scheduler event. When I am dynamically assigning the items to this custom field (as you can see in the attachment inside app.config.ts file under beforeEventEditShow listener ) if we select the value and click on save button in editor window , it sets the display text as it's value rather than actually taking it's value.

Attachments
ComboFieldIssuePNG.PNG
ComboFieldIssuePNG.PNG (21.96 KiB) Viewed 291 times
Scheduler-Demo.zip
(417.49 KiB) Downloaded 39 times

Post by alex.l »

This happened because you set items: [''], as default data for combo.
When combo creates with items property, it checks data structure in items array, if any, and determine what valueField/displayField pair should be used.
items may be used with a plain array of values (['Name', 'Word', 'Cold']), and in that case valueField and displayField shouldn't be "value" and "text". When you use an empty string as default data, that's what happened - combo recognized data structure as array of strings and set valueField and displayField for that data structure.
So, you need to use correct format for default data, or use empty array as default data, or set valueField/displayField by your own as a part of combo config and don't allow the combo to make it automatically.

All the best,
Alex


Post Reply