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. Image for the cookie policy date
close icon

How do I Prevent Popup with PopupOpen?

Hi I cannot seem to prevent the scheduler popups from opening.
I have tried with a Blazor function and using Javascript interop - but neither seems to work.

Using Blazor function

@page "/"
@inject  IJSRuntime JsRuntime
@using Syncfusion.EJ2.RazorComponents.Schedule
@inherits IndexModel


<EjsSchedule id="schedule" height="650px" selectedDate="DateTime.UtcNow" FirstDayOfWeek="1" ShowWeekNumber="false" CurrentView="View.Month" EventSettings="@ScheduleData" PopupOpen="@CancelPopup">
    <ScheduleViews>
        <ScheduleView option='@WeekView' startHour='@WeekStartHour' endHour='@WeekEndHour'></ScheduleView>
        <ScheduleView option='@WorkWeekView' startHour='@WorkWeekStartHour' endHour='@WorkWeekEndHour'></ScheduleView>
        <ScheduleView option='@MonthView' showWeekend='true' EventTemplate="#event-template">
        </ScheduleView>
        <ScheduleView option="@DayView"></ScheduleView>
    </ScheduleViews>
</EjsSchedule>



@functions{
    public void CancelPopup(PopupOpenEventArgs args)
    {
        args.Cancel = true;
    }
}

using Javascript interop

@page "/"
@inject  IJSRuntime JsRuntime
@using Syncfusion.EJ2.RazorComponents.Schedule
@inherits IndexModel


<EjsSchedule id="schedule" height="650px" selectedDate="DateTime.UtcNow" FirstDayOfWeek="1" ShowWeekNumber="false" CurrentView="View.Month" EventSettings="@ScheduleData" PopupOpen="@CancelPopup">
    <ScheduleViews>
        <ScheduleView option='@WeekView' startHour='@WeekStartHour' endHour='@WeekEndHour'></ScheduleView>
        <ScheduleView option='@WorkWeekView' startHour='@WorkWeekStartHour' endHour='@WorkWeekEndHour'></ScheduleView>
        <ScheduleView option='@MonthView' showWeekend='true' EventTemplate="#event-template">
        </ScheduleView>
        <ScheduleView option="@DayView"></ScheduleView>
    </ScheduleViews>
</EjsSchedule>



@functions{
    public void CancelPopup(PopupOpenEventArgs args)
    {
        JsRuntime.InvokeAsync<bool>("genericCancel", args);
    }
}
 ... on my _Host.cshtml page
<script type="text/javascript">
        function genericCancel(args) {
            args.cancel = true;
        }
    </script>

Any Ideas?

Also, anything above v17.1.0.47-beta seems to crash the scheduler after a couple of clicks.

Thanks, would really love to use the Blazor components, but this is a bit of a show-stopper if I cannot prevent the popup.




1 Reply

KK Karthigeyan Krishnamurthi Syncfusion Team May 31, 2019 10:19 AM UTC

Hi Matthew, 
 
Sorry for the delay in getting back to you. 
 
Q1: Currently we have an issue in sending event argument changes to the component. Due to this issue, you cannot prevent the popup from opening. We have considered this as defect and already logged the feedback that can be tracked using the link below. It will be included in our upcoming release Volume2 2019, which is expected to roll out by June end, 2019.  Until then, we appreciate your patience. 
 
 
Q2: We have checked the reported case by removing the below highlighted EventTemplate property in version 17.1.49-beta and Schedule working fine at our end. Please find the below sample for the same.  
 
 
    <ScheduleViews>
        <ScheduleView option='@WeekView' startHour='@WeekStartHour' endHour='@WeekEndHour'></ScheduleView>
        <ScheduleView option='@WorkWeekView' startHour='@WorkWeekStartHour' endHour='@WorkWeekEndHour'></ScheduleView>
        <ScheduleView option='@MonthView' showWeekend='true' EventTemplate="#event-template">
        </ScheduleView>
        <ScheduleView option="@DayView"></ScheduleView>
    </ScheduleViews>
 
 
 
Currently, we don’t have the template support for our blazor components. We have logged the feature request already in the following feedback location and scheduled to be included in our upcoming release Volume2 2019, which is expected to roll out by June end, 2019. 
 
Please let me know if you have any questions. 
 
Regards, 
Karthi 
 


Loader.
Live Chat Icon For mobile
Up arrow icon