Our powerful JS Calendar component


Post 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.

Attachments
minimal test case.zip
Test case without the Bryntum files included
(2.38 KiB) Downloaded 58 times

Post by alex.l »

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

Attachments
Screenshot 2022-05-02 at 16.20.39.png
Screenshot 2022-05-02 at 16.20.39.png (60.48 KiB) Viewed 1116 times

All the best,
Alex


Post 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

Attachments
placeholderInExample.png
placeholderInExample.png (136.38 KiB) Viewed 1107 times

Post 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".

All the best,
Alex


Post 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/)

Attachments
Screenshot taken in the "basic" example
Screenshot taken in the "basic" example
placeholderCreationBasicExample.png (41.64 KiB) Viewed 1005 times

Post 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

All the best,
Alex


Post 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 831 times

Post by durban »

It works for me!
Thank you for your time


Post 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 823 times

Post Reply