Core Schedule - SignalR and LoadOnDemand

Hi,
there is a basic description of how to implement SignalR for the pre-Core control of the Schedule. I have implemented LoadOnDemand for the given view, and would now be interested to find out how I could push updates made by other users to the component.
Let's say User1 added an appointement and leaves the website open.
User 2 adds an appointment on another computer.
User1 returns to the website 30 minutes later. How could I make sure that the appointment by User2 is visible, ideally without reloading, and ideally only if the appointment intersects with the chosen view of User1?

3 Replies

KK Karthigeyan Krishnamurthi Syncfusion Team November 2, 2017 10:32 AM UTC

Hi Stefan,   
  
Thank you for contacting Syncfusion support. 
 
We have prepared the signalR sample in Core platform which can be download from the below location. 
 
<Code> 
<ej-schedule id="Schedule1" width="100%" height="525px" before-appointment-change="actionComplete" before-appointment-create="actionComplete" before-appointment-remove="actionComplete" current-date="new DateTime(2016, 6, 2)"> 
    <e-appointment-settings apply-time-offset="false" id="Id" subject='"Subject"' start-time='"StartTime"' end-time='"EndTime"' all-day='"AllDay"' recurrence='"Recurrence"' recurrence-rule='"RecurrenceRule"'> 
        <e-datamanager id="Data" json="ViewBag.datasource"></e-datamanager> 
    </e-appointment-settings> 
</ej-schedule> 
<script src="~/lib/jquery/dist/jquery.js"></script> 
<script type="text/javascript"> 
    $(function () { 
        $.getScript('https://ajax.aspnetcdn.com/ajax/signalr/jquery.signalr-1.1.4.min.js', function () { 
            $.getScript('http://js.syncfusion.com/ejservices/signalr/hubs', function () { 
                $.signalR.hub.url = 'http://js.syncfusion.com/ejservices/signalr'; 
                window.signalr = $.signalR.scheduleHub; 
                window.signalr.client.modify = function (action, data) { 
                    $("#Schedule1").ejSchedule('instance').notifyChanges(action, data); 
                }; 
                $.signalR.hub.start({ jsonp: true }).done(function () { 
                    window.actionComplete = function (args) { 
                        if (args.methodType != "public" && (args.type == "beforeAppointmentCreate" || args.type == "beforeAppointmentChange" || args.type == "beforeAppointmentRemove")) { 
                            window.signalr.server.modify(args.type, args.appointment); 
                        } 
                    }; 
                }); 
            }); 
        }); 
    }); 
</script> 
</Code> 
 
Regards,  
Karthigeyan  




ST Stefan November 2, 2017 12:09 PM UTC

Hi Karthigeyan,

if I am not mistaken this is a .Net Core 1.0 application, that uses Gray.Microsoft.AspNetCore.SignalR.Server Version 0.2.0-alpha1.

That NuGet package is outdated, and directly references dependencies that can no longer be obtained. I get hundreds of errors such as these:

Gray.Microsoft.AspNetCore.SignalR.Server 0.2.0-alpha1 depends on Microsoft.AspNetCore.Http.Extensions (>= 1.1.0-alpha1-22144) but Microsoft.AspNetCore.Http.Extensions 1.1.0-alpha1-22144 was not found. An approximate best match of Microsoft.AspNetCore.Http.Extensions 1.1.0-preview1-final was resolved.

Error Detected package downgrade: Microsoft.ApplicationInsights.AspNetCore from 2.1.1 to 1.0.0. Reference the package directly from the project to select a different version.

For Core 2.0 applications the new SignalR (Microsoft.AspNetCore.SignalR (1.0.0-alpha2-final) has been released (https://github.com/aspnet/SignalR), which I am using in for my evaluation project.

Even though I'm unable to run this directly, I'll try to figure out what it does and translate it to Core 2/SignalR Core; should I succeed I'll post my results here.

Still, thank you for your help!




KK Karthigeyan Krishnamurthi Syncfusion Team November 3, 2017 11:02 AM UTC

 
Thanks for your update. 
 
Yes, the provided sample was .Net Core 1.0 version and would like to inform that the solution used in our previous sample is applicable for Core version 2.0.  
 
Kindly try our solution in your project and let us know if you need further assistance. 
 
Regards, 
Karthigeyan 
 



Loader.
Up arrow icon