Our powerful JS Calendar component


Post by braincept »

We are showing events from external calendars (such as Google Calendar, iCloud, Microsoft Office 365, ...). Those are readonly events for us. So it should be possible to remove edit and delete button in the event tooltip. Right now the button is there, but has no functionality which confuses our customers.

Thanks for checking!

Best regards,
Patrick

Attachments
Bildschirmfoto 2021-05-27 um 09.37.43.png
Bildschirmfoto 2021-05-27 um 09.37.43.png (77.82 KiB) Viewed 792 times

Post by mats »

That's easily, I've just updated the docs to make this clearer:

/**
 * A feature which displays a {@link #config-tooltip} containing extra information. The tooltip can
 * be triggered by clicking or hovering an event bar element (see {@link #config-showOn}).
 *
 * ```javascript * new Calendar({
 *    features : {
 *        eventTooltip : {
 *            tooltip : {
 *                tools : {
 *                    // Do not show the Delete tool in the tooltip header
 *                    delete : false
 *                }
 *            }
 *        }
 *    }
 * })
 * ```

Post by braincept »

Thanks for the answer mats. But how can this be done on a per-event case? Not every event is read-only.


Post by saki »

You can install beforeShow listener and decide if you want to show or hide a button from tools based on the hovered event. This thread shows more details: https://forum.bryntum.com/viewtopic.php?f=44&t=17978&p=89069&hilit=beforeshow#p89069

In the listener, you can hide/show tools like this:

            features : {
                eventTooltip : {
                    onBeforeShow({ source : tooltip }) {
                        tooltip.title = StringHelper.encodeHtml(tooltip.eventRecord.name);
                        tooltip.tools[0].hidden = true; // your condition here based on which eventRecord is this
                    },

Post by braincept »

Thanks saki! We will give it a try.


Post Reply