Page 1 of 1

Can't override nameField's Placeholder

Posted: Fri Apr 29, 2022 5:30 pm
by durban

I tried to override the placeholder of nameField in the EventEdit of Calendar by using the code below.

eventEdit: {
            items: {
                nameField: {
                    clearable: true,
                    label: 'New Label',
                    placeholder: 'New Placeholder'
                }
            }
        }

If you check the test case, you can see that New Label is displayed but not New Placeholder.


Re: Can't override nameField's Placeholder

Posted: Mon May 02, 2022 10:21 am
by alex.l

Works well to me. Try to upgrade your sources or reproduce in our online examples.


Re: Can't override nameField's Placeholder

Posted: Tue May 03, 2022 9:17 am
by durban

I tried using an example (https://bryntum.com/examples/calendar/eventedit/) for testing the placeholder and I still couldn't override it.
I forgot to say that I'm using Bryntum Calendar 5.0.3


Re: Can't override nameField's Placeholder

Posted: Tue May 03, 2022 11:02 am
by alex.l

The "eventedit" demo uses material theme, which doesn't show placeholders for fields. I cannot reproduce it with "New event" text inside as on your screenshot.
If you try it with another example, let's say, with "basic" one, you'll see that. As well as if you replace the theme for "eventedit" example to "stockholm".


Re: Can't override nameField's Placeholder

Posted: Wed May 04, 2022 5:04 pm
by durban

It turns out that my problem is when I create an event, but when I edit an event, there is indeed no placeholder (that's what I want). In this screenshot, the placeholder is not what I want and it's been made in the "basic" example (https://bryntum.com/examples/calendar/basic/)


Re: Can't override nameField's Placeholder

Posted: Thu May 05, 2022 7:48 am
by alex.l

Thank you for your investigations. That looks like a bug, I've opened a ticket here: https://github.com/bryntum/support/issues/4568


Re: Can't override nameField's Placeholder

Posted: Tue May 10, 2022 4:13 pm
by Animal

Am I right in thinking that you do not want the placeholder to be "New Event" only when in create mode from dblclick?

If you configure your Calendar with this:

    modeDefaults : {
        autoCreate : {
            newName : ' ' // One space
        }
    },

Note that there is one space in that value. An empty string is falsy, so will not work.
The placeholder will not be visible:

Screenshot 2022-05-10 at 16.10.44.png
Screenshot 2022-05-10 at 16.10.44.png (84.05 KiB) Viewed 873 times

Re: Can't override nameField's Placeholder

Posted: Tue May 10, 2022 4:38 pm
by durban

It works for me!
Thank you for your time


Re: Can't override nameField's Placeholder

Posted: Tue May 10, 2022 4:54 pm
by Animal

That string is also localizeble.

You can add this to your locale file:

    Object : {
        newEvent : 'Nouvel évènement'
    }

And it would use that instead.

See https://bryntum.com/examples/calendar/localization/

Screenshot 2022-05-10 at 16.53.26.png
Screenshot 2022-05-10 at 16.53.26.png (193.35 KiB) Viewed 865 times