Forced PopUp ASYNC not working

Okay I have set the Quick popup to false and have tried to implement both OnCellClick and OnEventClick to force open the editor popup. However, When I try and type 

 await Schedule.OpenEditorAsync(args, CurrentAction.Add);

I get an error under OpenEditorAsync. 

It says that Schedule<Jobs> does not contain a definition for it.

When I try and type it as 

 await Schedule.OpenEditor(args, CurrentAction.Add);

The program will load and I can click on a cell or event. However, the moment I do i get an error in the program that says the specified cast is not valid. 


I am trying to create my own page that can popup when I click on an event


3 Replies

PN Praveenkumar Narasimhanaidu Syncfusion Team July 6, 2021 09:09 AM UTC

Hi Nathanael, 

Greetings from Syncfusion support..! 

Q1: Forced PopUp ASYNC not working 
We have validated your requirement and suspect that you are not using the latest version of our Syncfusion NuGet version. We suggest to update your scheduler package with latest version(19.2.44) to resolve the issue. If the issue still persists at your end, please share your scheduler code snippets and issue reproducing sample(if possible) to provide a prompt solution. 

   public async Task OnCellClick(CellClickEventArgs args) 
    { 
        args.Cancel = true; 
        await ScheduleRef.OpenEditorAsync(args, CurrentAction.Add);   //To open editor window on cell click 
    } 
    public async Task OnEventClick(EventClickArgs<AppointmentData> args) 
    { 
        args.Cancel = true; 
        await ScheduleRef.OpenEditorAsync(args.Event, CurrentAction.Save);   //To open the editor on event click 
    } 

Q2: I am trying to create my own page that can popup when I click on an event 
We have validated your requirement “Customized window on clicking event” and you can achieve this requirement by using either scheduler EditorTemplate or sfDialog model. Please find samples from the below link. 

Kindly try the above solution and get back to us if you need any further assistance. 

Regards, 
Praveenkumar 



NA Nathanael July 7, 2021 04:34 PM UTC

Okay, updating it did get rid of the error when trying to type OpenEditorAsync. However, when i load the program and click on an event or a cell, this error still pops up in the internet console:

crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]

      Unhandled exception rendering component: Specified cast is not valid.

System.InvalidCastException: Specified cast is not valid.

   at Syncfusion.Blazor.Schedule.Internal.ResourceRenderer`2[[WebJS.Shared.Objects.Installers, WebJS.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[System.Int32[], System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].OnComplete()

   at Syncfusion.Blazor.Schedule.Internal.ResourceRenderer`2.<OnParametersSetAsync>d__34[[WebJS.Shared.Objects.Installers, WebJS.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[System.Int32[], System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()

   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)

   at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()



SK Satheesh Kumar Balasubramanian Syncfusion Team July 8, 2021 11:36 AM UTC

Hi Nathanael, 
  
Thanks for your update. 
  
We have validated your reported query "However, when i load the program and click on an event or a cell, this error still pops up in the internet console:" and suspect that you may pass ScheduleResource TValue as "int" when AllowMultiple set as "true" which is the cause for this issue. For the same we have modified the sample for your reference which can be downloaded from the following link. 

  
Index.razor 
<SfSchedule TValue="AppointmentData" @ref="@ScheduleRef" Width="100%" Height="550px" ShowQuickInfo="false" @bind-SelectedDate="@CurrentDate"> 
    <ScheduleEvents TValue="AppointmentData" OnEventClick="OnEventClick" OnCellClick="OnCellClick"></ScheduleEvents> 
    <ScheduleGroup Resources="@Resources"></ScheduleGroup> 
    <ScheduleResources> 
        <ScheduleResource TItem="ResourceData" TValue="int[]" DataSource="@OwnersData" Field="OwnerId" Title="Owner" Name="Owners" TextField="OwnerText" IdField="Id" GroupIDField="OwnerGroupId" ColorField="OwnerColor" AllowMultiple="true"></ScheduleResource> 
    </ScheduleResources> 
    <ScheduleEventSettings DataSource="@DataSource"></ScheduleEventSettings> 
    <ScheduleViews> 
        <ScheduleView Option="View.Day"></ScheduleView> 
        <ScheduleView Option="View.Week"></ScheduleView> 
        <ScheduleView Option="View.WorkWeek"></ScheduleView> 
        <ScheduleView Option="View.Month"></ScheduleView> 
        <ScheduleView Option="View.Agenda"></ScheduleView> 
    </ScheduleViews> 
</SfSchedule> 
  
Kindly try the above sample and let us know if this meets your requirement. 
  
Regards, 
Satheesh Kumar B 


Loader.
Up arrow icon