To reproduce do the following:
<ScheduleEvents TValue="ScheduleData.ResourceData" ActionCompleted="OnActionCompleted">ScheduleEvents>
to the control and
public void OnActionCompleted(ActionEventArgs<ScheduleData.ResourceData> args) { if (args.RequestType == "eventCreated") { // will trigger when appointment created } if (args.RequestType == "eventRemoved") { // will trigger when appointment deleted } if (args.RequestType == "eventChanged") { // will trigger when appointment edited } }
to the code section. After this it is not possible to change the view.
regards
Uwe
<EjsSchedule TValue="ScheduleData.ResourceData" Width="100%" Height="650px" SelectedDate="@(new DateTime(2018, 4, 4))" @bind-CurrentView="@TimelineWeek">
<ScheduleGroup Resources="@GroupData"></ScheduleGroup>
<ScheduleResources>
<ScheduleResource DataSource="@ProjectData" Field="ProjectId" Title="Choose Project" Name="Projects" TextField="text" IdField="id" ColorField="color"></ScheduleResource>
<ScheduleResource DataSource="@TaskData" Field="TaskId" Title="Category" Name="Categories" TextField="text" IdField="id" GroupIDField="groupId" ColorField="color" AllowMultiple="true"></ScheduleResource>
</ScheduleResources>
<ScheduleViews>
<ScheduleView Option="View.TimelineDay"></ScheduleView>
<ScheduleView Option="View.TimelineWeek"></ScheduleView>
<ScheduleView Option="View.TimelineWorkWeek"></ScheduleView>
<ScheduleView Option="View.TimelineMonth"></ScheduleView>
<ScheduleView Option="View.Agenda"></ScheduleView>
</ScheduleViews>
<ScheduleEventSettings DataSource="@DataSource"></ScheduleEventSettings>
<ScheduleEvents TValue="ScheduleData.ResourceData" ActionCompleted="OnActionCompleted"></ScheduleEvents>
</EjsSchedule>
@code{
public View TimelineWeek = View.TimelineWeek;
public List<ScheduleData.ResourceData> DataSource = new ScheduleData().GetResourceData();
public string[] GroupData = new string[] { "Projects", "Categories" };
private List<object> ProjectData { get; set; } = new List<object> {
new {text = "PROJECT 1", id= 1, color= "#cb6bb2"},
new {text = "PROJECT 2", id= 2, color= "#56ca85"},
new {text = "PROJECT 3", id= 3, color= "#df5286"}
};
private List<object> TaskData { get; set; } = new List<object> {
new { text = "Nancy", id= 1, groupId = 1, color = "#df5286" },
new { text = "Steven", id= 2, groupId = 1, color = "#7fa900" },
new { text = "Robert", id= 3, groupId = 2, color = "#ea7a57" },
new { text = "Smith", id= 4, groupId = 2, color = "#5978ee" },
new { text = "Micheal", id= 5, groupId = 3, color = "#df5286" },
new { text = "Root", id= 6, groupId = 3, color = "#00bdae" }
};
public void OnActionCompleted(ActionEventArgs<ScheduleData.ResourceData> args)
{
if (args.RequestType == "eventCreated")
{
// will trigger when appointment created
}
if (args.RequestType == "eventRemoved")
{
// will trigger when appointment deleted
}
if (args.RequestType == "eventChanged")
{
// will trigger when appointment edited
}
}
} |
<EjsSchedule TValue="AppointmentData" CssClass="my-schedule" Width="100%" Height="650px" SelectedDate="@(new DateTime(2019, 1, 31))" @bind-CurrentView="@CurrentView">
<ScheduleGroup Resources="@GroupData"></ScheduleGroup>
<ScheduleResources>
<ScheduleResource DataSource="@ProjectData" Field="ProjectId" Title="Choose Project" Name="Projects" TextField="text" IdField="id" ColorField="color"></ScheduleResource>
<ScheduleResource DataSource="@TaskData" Field="TaskId" Title="Category" Name="Categories" TextField="text" IdField="id" GroupIDField="groupId" ColorField="color" AllowMultiple="true"></ScheduleResource>
</ScheduleResources>
<ScheduleViews>
<ScheduleView Option="View.TimelineDay"></ScheduleView>
<ScheduleView Option="View.TimelineWeek"></ScheduleView>
<ScheduleView Option="View.TimelineWorkWeek"></ScheduleView>
<ScheduleView Option="View.TimelineMonth"></ScheduleView>
<ScheduleView Option="View.Agenda"></ScheduleView>
</ScheduleViews>
<ScheduleEventSettings DataSource="@DataSource"></ScheduleEventSettings>
<ScheduleEvents TValue="AppointmentData" EventRendered="OnEventRendered"></ScheduleEvents>
</EjsSchedule>
….
public View CurrentView = View.TimelineWeek; |
public async void OnEventRendered(EventRenderedArgs<AppointmentData> args)
{
if (CurrentView != View.Agenda)
{
var style = await args.Element.GetAttribute("Style");
string height = style.ToString() + "height:98px;"; //reduce two pixels from the height of work cells for borders
args.Element.SetAttribute("Style", height);
}
} |
.e-schedule .e-agenda-view .e-content-wrap {
height: auto !important;
} |
public void ConfigureServices(IServiceCollection services)
{
services.AddRazorPages();
services.AddServerSideBlazor();
services.AddSingleton<WeatherForecastService>();
services.AddSignalR(e => {
e.MaximumReceiveMessageSize = 102400000;
});
} |