Our powerful JS Calendar component


Post by jeff.wang »

Hi,

How to add Dom replace of the emptyText when the events are empty in Agenda mode like below image, I want to show the Dom that including the image and text in the empty place.

Image

Thank you!


Post by marcio »

Hi Jeff,

We don't have that now, so I opened a feature request to add it https://github.com/bryntum/support/issues/5046

But as a workaround, you can set up like this to add some custom content to the agenda view

modes : {
        agenda : {
            range     : 'day',
            emptyText : '',
            listeners : {
                refresh : ({ source }) => {
                    // Has no items to display
                    if (source.data.length === 0) {
                        const container = document.querySelector('.b-grid-subgrid');
                        container.innerHTML = `<p>No items to display</p>`;
                    }
                }
            }
        }
    }

Best regards,
Márcio


Post by jeff.wang »

Ok, It is effect, hope to see the next version ASAP.

Thank you!


Post Reply