Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
147797 | Sep 24,2019 02:18 PM UTC | Oct 24,2019 02:01 PM UTC | Blazor | 7 |
![]() |
Tags: Scheduler |
<ScheduleEvents TValue="AppointmentData" OnPopupClose="OnEditorClose"></ScheduleEvents>
…
public void OnEditorClose(PopupCloseEventArgs<AppointmentData> args)
{
args.Cancel = true; //to prevent closing of the editor window
} |
EjsToast ToastObj;
private string groupName = "sm_salle";
private string message = "Someone Just Update Informations";
EjsSchedule<AppointmentData> ScheduleObj;
View CurrView = View.Week;
DateTime SelectedDate = new DateTime(2019, 1, 31);
HubConnection connection;
protected override async Task OnInitializedAsync()
{
connection.On<List<AppointmentData>>("RecieveData", OnDataChange);
connection.On<View>("ChangeView", OnChangeView);
connection.On<DateTime>("ChangeDate", OnChangeDate);
await connection.StartAsync();
}
public void OnActionCompleted(ActionEventArgs<AppointmentData> args)
{
if (args.RequestType == "eventCreated" || args.RequestType == "eventRemoved" || args.RequestType == "eventChanged")
{
connection.InvokeAsync("SendData", DataSource);
}
}
Task OnDataChange(List<AppointmentData> data)
{
this.DataSource = data;
this.ScheduleObj.Refresh();
var model = new ToastModel() { Content = message, Title = groupName };
this.ToastObj.Show(model);
return Task.CompletedTask;
} |
public class ScheduleHub:Hub
{
public async Task SendData(List<Index.AppointmentData> data)
{
await Clients.Others.SendAsync("RecieveData", data);
}
public async Task SendViewData(View data)
{
await Clients.Others.SendAsync("ChangeView", data);
}
public async Task SendSelectedDateData(DateTime data)
{
await Clients.Others.SendAsync("ChangeDate", data);
}
}
}
|
protected override async Task OnInitializedAsync()
{
connection.On<List<AppointmentData>, string>("RecieveData", OnDataChange);
connection.On<View>("ChangeView", OnChangeView);
connection.On<DateTime>("ChangeDate", OnChangeDate);
await connection.StartAsync();
}
public void OnActionCompleted(ActionEventArgs<AppointmentData> args)
{
if (args.RequestType == "eventCreated" || args.RequestType == "eventRemoved" || args.RequestType == "eventChanged")
{
connection.InvokeAsync("SendData", DataSource, args.RequestType);
}
}
async Task OnDataChange(List<AppointmentData> data, string action)
{
this.DataSource = data;
this.ScheduleObj.Refresh();
await Task.Delay(100);
var model = new ToastModel() { Content = action, Title = groupName };
this.ToastObj.Show(model);
} |
public async Task SendData(List<Index.AppointmentData> data, string action)
{
await Clients.Others.SendAsync("RecieveData", data, action);
} |
<style>
.my-schedule.e-schedule .e-timeline-view .e-resource-cells,
.my-schedule.e-schedule .e-timeline-view .e-work-cells {
height: 70px;
}
.my-schedule.e-schedule .e-timeline-month-view .e-resource-cells,
.my-schedule.e-schedule .e-timeline-month-view .e-work-cells {
height: 90px;
}
.my-schedule.e-schedule .e-appointment {
height: 68px;
}
.my-schedule.e-schedule .e-agenda-view .e-appointment {
height: 30px;
}
</style> |
.my-schedule.e-schedule .e-today {
display: none;
} |
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.
This page will automatically be redirected to the sign-in page in 10 seconds.