<ScheduleTemplates>
<DateHeaderTemplate>
<div class="date-text">@(GetDateHeaderText((context as TemplateContext).Date))</div>
</DateHeaderTemplate>
</ScheduleTemplates>
…
<ScheduleTimeScale>
<MajorSlotTemplate>
@{
var currTime = MajorSlotTemplate((context as TemplateContext).Date);
var nextTime = Convert.ToInt32(currTime) + 4;
<div>@(currTime + "h-" + nextTime + "h")</div>
}
</MajorSlotTemplate>
</ScheduleTimeScale>
…
<Template>
<div>@((context as AppointmentData).Subject)</div>
<div>De: @((context as AppointmentData).StartTime.ToString("hh:mm")) A: @((context as AppointmentData).EndTime.ToString("hh:mm"))</div>
</Template> |
….
<ScheduleTimeScale>
<MajorSlotTemplate>
@{
var currTime = MajorSlotTemplate((context as TemplateContext).Date);
var nextTime = Convert.ToInt32(currTime) + 4;
<div>@(currTime + "h-" + nextTime + "h")</div>
}
</MajorSlotTemplate>
</ScheduleTimeScale>
<ScheduleViews>
<ScheduleView Option="View.TimelineDay">
<ScheduleViewTimeScale Interval="240" SlotCount="1">
</ScheduleViewTimeScale>
</ScheduleView>
<ScheduleView Option="View.TimelineWeek" DateFormat="dd-MMM-yyyy" StartHour="08:00" EndHour="16:00">
<ScheduleViewTimeScale Interval="240" SlotCount="1">
</ScheduleViewTimeScale>
</ScheduleView>
<ScheduleView Option="View.TimelineMonth"></ScheduleView>
<ScheduleView Option="View.Agenda"></ScheduleView>
</ScheduleViews>
….. |
@using Syncfusion.EJ2.Blazor.Schedule
@if (grappeSalleLists == null && sallesList == null)
{
<p><em>Loading...</em></p>
}
else
{
<EjsSchedule TValue="AppointmentData" Width="100%" Height="650px">
<ScheduleGroup Resources="@resources"></ScheduleGroup>
<ScheduleResources>
<ScheduleResource TValue="GrappeSalle" DataSource="@grappeSalleLists" Field="IdGrappeSys" Title="Choose Project" Name="Grappes" TextField="NomGrappe" IdField="IdGrappeSys" ColorField="Color" AllowMultiple="false"></ScheduleResource>
<ScheduleResource TValue="SalleExamenSys" DataSource="@sallesList" Field="IdSalleExamenSys" Title="Salle Examen" Name="SalleExamens" TextField="NomSalle" IdField="IdSalleExamenSys" GroupIDField="IdGrappeSys" AllowMultiple="true" ColorField="Color"></ScheduleResource>
</ScheduleResources>
</EjsSchedule>
}
@code {
public List<GrappeSalle> grappeSalleLists;
public List<SalleExamenSys> sallesList;
public string[] resources { get; set; } = new string[] {"Grappes", "SalleExamens"};
protected override async Task OnInitializedAsync()
{
sallesList = await salleExamenList();
grappeSalleLists = await grappeSalleList();
}
…
…
} |
@using Syncfusion.EJ2.Blazor
@using Syncfusion.EJ2.Blazor.Schedule
@using Syncfusion.EJ2.Blazor.Data
<EjsSchedule TValue="AppointmentData" Width="100%" Height="650px">
<ScheduleGroup Resources="@resources"></ScheduleGroup>
<ScheduleResources>
<ScheduleResource TValue="GrappeSalle" Field="IdGrappeSys" Title="Choose Project" Name="Grappes" TextField="NomGrappe" IdField="IdGrappeSys" ColorField="Color" AllowMultiple="false">
<EjsDataManager AdaptorInstance="@typeof(CustomAdaptor1)" Adaptor="Adaptors.CustomAdaptor"></EjsDataManager>
</ScheduleResource>
<ScheduleResource TValue="SalleExamenSys" Field="IdSalleExamenSys" Title="Salle Examen" Name="SalleExamens" TextField="NomSalle" IdField="IdSalleExamenSys" GroupIDField="IdGrappeSys" AllowMultiple="true" ColorField="Color">
<EjsDataManager AdaptorInstance="@typeof(CustomAdaptor2)" Adaptor="Adaptors.CustomAdaptor"></EjsDataManager>
</ScheduleResource>
</ScheduleResources>
</EjsSchedule>
@code {
public class CustomAdaptor1 : DataAdaptor
{
public async override Task<object> ReadAsync(DataManagerRequest dataManagerRequest, string key = null)
{
List<GrappeSalle> ScheduleData = await grappeSalleList();
return dataManagerRequest.RequiresCounts ? new DataResult() { Result = ScheduleData, Count = ScheduleData.Count() } : (object)ScheduleData;
}
}
public class CustomAdaptor2 : DataAdaptor
{
public async override Task<object> ReadAsync(DataManagerRequest dataManagerRequest, string key = null)
{
List<SalleExamenSys> ScheduleData = await salleExamenList();
return dataManagerRequest.RequiresCounts ? new DataResult() { Result = ScheduleData, Count = ScheduleData.Count() } : (object)ScheduleData;
}
}
….
….
} |