EventTemplate
Is there way to customize the look of an event in the scheduler?
Any Text or html-Text in EventTemplate does not work.
SIGN IN To post a reply.
4 Replies
SL
Steven Littleford
July 18, 2019 03:23 AM UTC
Yep - mee too!
I'd like to be able to change the color of an appointment based on the underlying data within the appointment.
HB
Hareesh Balasubramanian
Syncfusion Team
July 18, 2019 12:22 PM UTC
Hi Otmar,
Greetings from Syncfusion Support.
We have prepared the sample to customize the event using Template option which can be downloaded from the following link,
|
<ScheduleEventSettings DataSource="@DataSource">
<Template>
<div>Subject: @((context as dynamic).Subject)</div>
<div>StartTime: @((context as dynamic).StartTime)</div>
<div>EndTime: @((context as dynamic).EndTime)</div>
</Template>
</ScheduleEventSettings> |
Please try the above sample, if you have any concerns please revert us back for further assistance.
Note: We have removed the packages for the above sample.
Regards,
Hareesh B
HB
Hareesh Balasubramanian
Syncfusion Team
July 18, 2019 12:25 PM UTC
Hi Steven,
Greetings from Syncfusion Support.
We have prepared the sample for your requirement using eventRendered event which can be downloaded from the following link,
|
public void onEventRendered(EventRenderedArgs args)
{
BlogSite bsObj = JsonConvert.DeserializeObject<BlogSite>(JsonConvert.SerializeObject(args.Data));
DateTime localDate = bsObj.StartTime.ToLocalTime();
var hours = localDate.TimeOfDay.Hours;
if (hours < 12)
{
(args.Element).AddClass(this.cus1_class);
}
else if (hours >= 12 && hours < 18)
{
(args.Element).AddClass(this.cus2_class);
}
else if (hours >= 18)
{
(args.Element).AddClass(this.cus3_class);
}
} |
Please try the above sample, if you have any concerns please revert us back for further assistance.
Note: We have removed the packages for the above sample.
Regards,
Hareesh B
MA
Matthew
August 2, 2019 11:09 AM UTC
@((context as dynamic).Workcode)
@code{
public class TemplateArgs
{
public string Workcode { get; set; }
public string WorkcodeName { get; set; }
public string CandidateName { get; set; }
public string CandidateColor { get; set; }
public string TimesheetColor { get; set; }
public bool AllDay { get; set; }
}
public TemplateArgs model = new TemplateArgs();
protected override async Task OnInitAsync()
{
_summary = await assignmentDataService.GetAssignmentItemSummary(7000, null, null, null, null);
StateHasChanged();
}
}
Please ignore, I was not setting start time and end time in my data source
SIGN IN To post a reply.
- 4 Replies
- 4 Participants
-
OG Otmar Ganahl
- Jul 17, 2019 08:04 AM UTC
- Aug 2, 2019 11:09 AM UTC