Our pure JavaScript Scheduler component


Post by fract »

I have a combo and I wish when I select an item that the returned value is the selected object and not just a single field.
{
                type        : 'combo',
                name        : 'test',
                label       : 'Test',
                store       : [
                  {id:"1", name:"name1", value:"value1"}, 
                  {id:"2", name:"name2", value:"value2"},
                  {id:"3", name:"name3", value:"value3"}
                ],
                displayField: 'name',
                index       : 1,
            }

I want the returned value to be of this type :
{id:"1", name:"name1", value:"value1"}

I am using angular 7.

thank in advance

Post by mats »

Sounds like you are looking for the 'record' property: https://bryntum.com/docs/scheduler/#Common/widget/Combo#property-record

Post by fract »

how to assign this value directly to the event in creation or modification?
thank in advance

Post by pmiklashevich »

You can override onBeforeSave template method our subscribe to beforeeventsave. By default EventEditor will try to apply value to the key provided by `name` property of your widget. In your code snippet it will try to use 'test' and set value, where value is your widget.value according to the valueField
eventRecord.set({ test : value})

Pavlo Miklashevych
Sr. Frontend Developer


Post by fract »

with OnBeforeSave, it does not work, the new value is overwritten by the old one

Post by pmiklashevich »

I don't see your implementation of OnBeforeSave function. Please provide a runnable testcase based on one of our samples that shows the issue.

Pavlo Miklashevych
Sr. Frontend Developer


Post Reply