<EjsButton OnClick="@AddResources" Content="Add Resource"></EjsButton>
EjsSchedule<AppointmentData> ScheduleObj;
public List<object> ResourceData { get; set; } = new List<object>
{
new { text= "Jack", id= 9, color= "#ea7a57", capacity= 31, type= "Conference" }
};
public void AddResources()
{
this.ScheduleObj.AddResource(ResourceData, "Rooms", 0);
} |
<ScheduleTemplates>
<ResourceHeaderTemplate>
<div class='template-wrap'>
<div class="room-name">@((context as dynamic).ResourceData.Text)</div>
<div class="room-type">@((context as dynamic).ResourceData.Capacity)</div>
<div class="room-capacity">@((context as dynamic).ResourceData.Type)</div>
</div>
</ResourceHeaderTemplate>
</ScheduleTemplates>
public class TemplateArgs
{
public ResourceDataModel ResourceData { get; set; }
}
public class ResourceDataModel
{
public string Type { get; set; }
public string Text { get; set; }
public int Capacity { get; set; }
}
public TemplateArgs Model = new TemplateArgs(); |
I also adjusted link and script tags in _Host.chtml to:
<link rel='nofollow' href="https://cdn.syncfusion.com/ej2/17.2.40/material.css" rel="stylesheet" /> <script src="https://cdn.syncfusion.com/ej2/17.2.40/dist/ej2.min.js">script> <script src="https://cdn.syncfusion.com/ej2/17.2.40/dist/ejs.interop.min.js">script>
Maybe you can take a closer look - to me it looks like a bug in server-side blazor.
regards
Uwe
public void ConfigureServices(IServiceCollection services)
{
services.AddRazorPages();
services.AddServerSideBlazor();
services.AddSingleton<WeatherForecastService>();
services.AddSignalR(e => {
e.MaximumReceiveMessageSize = 102400000;
});
} |