0

How to disable the event ghost in ZK Calendar?

asked 2020-04-20 21:07:28 +0800

rsheth gravatar image rsheth
103 2

Hello All,

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.

image description

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.

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-04-22 15:54:58 +0800

MDuchemin gravatar image MDuchemin
1708 1 5
ZK Team

Hi there,

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>
link publish delete flag offensive edit

Comments

@MDuchemin, Thanks for you reply. It's really helpful. I used the 2nd solution as I wanted to show/hide this event ghost based on certain conditions. So removing/adding the sclass "no-ghost" dynamically to the parent div of the calendars component, based on the conditions, did the trick.

rsheth ( 2020-04-23 23:03:43 +0800 )edit

Thanks for the answer :)

MDuchemin ( 2020-04-24 15:07:16 +0800 )edit

You can also put the no-ghost (or other custom sclass name) directly on the calendar itself, if you want a more specific target.

MDuchemin ( 2020-04-24 15:08:04 +0800 )edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2020-04-20 21:07:28 +0800

Seen: 7 times

Last updated: Apr 22

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More