Our pure JavaScript Scheduler component


Post by portlink »

Hi there, I am having trouble putting a text input or a dropdown onto the event

https://bryntum.com/products/scheduler/examples/airport/

                    {
                        //class : 'outbound',
                        tag  : 'input',
                        type  : 'text'
                    },
     

when i click on the input, it automatically gets deselected again.

Attachments
image.png
image.png (126.72 KiB) Viewed 280 times

Post by tasnim »

Hi,

We don't have this supported. I've opened a feature request for that here https://github.com/bryntum/support/issues/8753

Best of luck :),
Tasnim


Post by mats »

@portlink Can you please share some details about your use case? Are you looking to have a quick way to edit a field in your event model via an INPUT element?


Post by portlink »

yes either an input or a dropdown or something similar. The reason for this is like you said, a quick way to edit a field. Reason being is that we want to reduce an extra step needed to edit that field.


Post by mats »

Ok, thanks for the quick update. Not trivial to support currently but we'll discuss internally.


Post by portlink »

No worries, thank you for discussing it. Do you guys happen to know of a workaround at the moment that would work?


Post by johan.isaksson »

While not exactly what you are asking for, the SimpleEventEdit feature would give you a lighter editing experience. Perhaps worth trying https://bryntum.com/products/scheduler/examples/simpleeditor

Best regards,
Johan Isaksson

Post by johan.isaksson »

You could also try using the Editor widget (https://bryntum.com/products/scheduler/docs/api/Core/widget/Editor). The docs on it are very brief, but you can check the sources for SimpleEventEdit to get the hang of it.

Something like this could work:

 eventRenderer({ eventRecord })  {
        return [
            {
                tag   : 'input',
                value : eventRecord.name
            }
        ];
    }
EventHelper.on({
    element  : scheduler.timeAxisSubGridElement,
    delegate : 'input',
    click(event) {
        const
            eventRecord = scheduler.resolveEventRecord(event),
            editor = new Editor({
                appendTo     : scheduler.timeAxisSubGridElement,
                align        : 'c-c',
                scrollAction : 'realign',
                style        : 'z-index: 10'
            });

    editor.startEdit({
        target : event.target,
        record : eventRecord,
        field  : 'name'
    });
}
});
Best regards,
Johan Isaksson

Post by portlink »

Thank you for providing the info, I will check the editor widget out to see if i can use it.


Post by portlink »

johan.isaksson wrote: Fri Mar 08, 2024 9:27 am

You could also try using the Editor widget (https://bryntum.com/products/scheduler/docs/api/Core/widget/Editor). The docs on it are very brief, but you can check the sources for SimpleEventEdit to get the hang of it.

Something like this could work:

 eventRenderer({ eventRecord })  {
        return [
            {
                tag   : 'input',
                value : eventRecord.name
            }
        ];
    }
EventHelper.on({
    element  : scheduler.timeAxisSubGridElement,
    delegate : 'input',
    click(event) {
        const
            eventRecord = scheduler.resolveEventRecord(event),
            editor = new Editor({
                appendTo     : scheduler.timeAxisSubGridElement,
                align        : 'c-c',
                scrollAction : 'realign',
                style        : 'z-index: 10'
            });

    editor.startEdit({
        target : event.target,
        record : eventRecord,
        field  : 'name'
    });
}
});

Hey there, do you think you can provide an example with https://bryntum.com/products/scheduler/examples/airport/

i have been trying to get it working but I have not been able to.


Post Reply