Our powerful JS Calendar component


Post by gustavo.rosendo »

Hi guys,

In the event edit popup, currently when a required field is left empty, that field color is changed to red but the error message is displayed only on the hover of the mouse.

I would like to customize it to show not only on the hover of the mouse, but as soon as the user clicks on the 'save' button and the validation fails.
Or even better, show a validation error message just below the text field.

How can I achieve this? Is it possible?

Thanks in advance,
Gustavo M R Santos


Post by marcio »

Hey Gustavo,

It'll depend on which field are you referring to. As you probably know, there are several built-in widgets for the event editor
https://www.bryntum.com/docs/calendar/api/Scheduler/feature/EventEdit#built-in-widgets

But let's take TextField as an example, as others are similar to it. You add a hint text https://www.bryntum.com/docs/calendar/api/Core/widget/TextField#config-hint
or even some custom element with https://www.bryntum.com/docs/calendar/api/Core/widget/TextField#config-hintHtml

eventEdit : {
            items : {
                nameField : {
                    hintHtml : ({ source, value }) => {
                        return !value ? '<div>Invalid value</div>' : '';
                    }
                }
            }
        }

Best regards,
Márcio


Post by Animal »

Maybe we need a config which means that the error tooltip is shown immediately upon detection of invalid state?

autoShowErrorTip?

So Field would get this change:

Screenshot 2022-08-10 at 08.15.40.png
Screenshot 2022-08-10 at 08.15.40.png (219.04 KiB) Viewed 546 times

Post by gustavo.rosendo »

Thanks for the answers, Marcio and Animal!

I've tried using the hint and hintHtml suggestions, but they are not quite what I am looking for since they will act as an overlay on whatever is already input and not as an error message.
In my case, Animal's solution would be very much appreciated because we are trying to show the error tooltip right away to keep the user from being confused.

Thanks again and best regards!
Gustavo M R Santos


Post by marcio »

Thanks for the clarification Gustavo, I created a feature request ticket for the new request https://github.com/bryntum/support/issues/5051

Best regards,
Márcio


Post Reply