zkzulzk-calendar

How to disable the event ghost in ZK Calendar?


I'm using ZK CE-9.0.0 & zk-calendar-2.1.5 source code.

I'm handling the event onEventCreate of calendars, to create new events in the calendar. Whenever I'm doing so, an event ghost/dragging ghost is also created. Please refer to the below screenshot.

enter image description here

I want to get rid of this event ghost. I achieve this by executing the following piece of code placed inside the event handling method:

@Listen("onEventCreate = #calendars")
public void createEvent(CalendarsEvent event) {
     event.clearGhost();
}

Although this code works, the event ghost still appears for half a second. While I want that this event ghost doesn't appear on screen at all.

How can I achieve the same?

Thanks,

RAS


Solution

  • Simplest solution would be to use a style to hide the ghost event.

    <style>
        .z-calendars-evt-ghost{
            opacity: 0;
        }
    </style>
    

    if you want to apply this to a specific component, you can use a sclass on the calendars component and include it in the style declaration:

    <style>
        .no-ghost .z-calendars-evt-ghost{
            opacity: 0;
        }
    </style>
    
    <div sclass="no-ghost" >
        <calendars id="calendars"/>
    </div>