We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

refreshEvents closes the popup?

Thread ID:

Created:

Updated:

Platform:

Replies:

145957 Jul 15,2019 11:12 PM UTC Jul 17,2019 08:42 AM UTC Angular - EJ 2 3
loading
Tags: Schedule
Chris Cunningham
Asked On July 15, 2019 11:12 PM UTC

Hi,

I'm seeing some odd behaviour. In my application, I have some code to colour events when they have been clicked on, by setting a property on them, and then using u this in onEventRendered to set the colour. In order to make onEventRendered fire, I'm calling refreshEvents().

The problem is that a lot of the time, the refreshEvents() call closes the popup as soon as it appears, which is not the desired behaviour. Is there a way to either:
 - Re-render that specific event without calling refreshEvents()
 - Make refreshEvents() not close the popup?

Thanks,
-Chris

Vinitha Devi Murugan [Syncfusion]
Replied On July 16, 2019 01:27 PM UTC

Hi Chris, 
 
Greetings from Syncfusion. 
 
Please share the following details. 
 
  1. Where you have set the color code to the events.
  2. If have set the color code and call the refreshEvents within eventClick event, share the code snippet you have tried.
  3. Share the detail of popup, like you are mentioning quick popup or detailed event window.
 
Kindly share the requested details so that we could check the problem and provide the solution at earliest. 
 
Regards, 
M.Vinitha devi. 


Chris Cunningham
Replied On July 16, 2019 08:10 PM UTC

Hi,

My eventRendered code colours events based on whether they're part of a separate "selectedJobMasterIds" set (driven from other parts of the UI), and  looks like:

  onEventRendered(args: EventRenderedArgs): void {
    let jobEvent: CalendarEvent = <CalendarEvent><unknown>args.data;
    var colour = "green";
    if (jobEvent.job.isClosed) {
      colour = "darkgrey";
    } else if (this.selectedJobMasterIds.has(jobEvent.jobMasterId)) {
      colour = "#FF6A00";
    }
    args.element.style.backgroundColor = colour;
  }


My eventClick does the following to add the event to the external selected list ("selectedJobMasterIds"), and then re-render everything:

        this.selectedJobMasterIds.add(jobEvent.jobMasterId);
        this.scheduleObj.refreshEvents();

The popup is the quick popup. It appears extremely briefly, before disappearing. I believe this is due to the refreshEvents() call.

Karthigeyan Krishnamurthi [Syncfusion]
Replied On July 17, 2019 08:42 AM UTC

Hi Chris 
 
Thanks for the update. 
 
We suspect that your requirement is to change the event color when it is clicked. When have prepared the below sample to customize the event color using eventClick event based on Status field. 
 
onEventClick (args: EventClickArgs): void { 
    let obj = (args.event as any).Status; 
    if (obj === "Inprogress") { 
      (args.element as HTMLElement).style.background = "gray"; 
    } else if (obj === "Closed") { 
      (args.element as HTMLElement).style.background = "green"; 
    } else if (obj === "Open") { 
     (args.element as HTMLElement).style.background = "brown"; 
    } 
  } 
 
Regards, 
Karthi 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon