@using Syncfusion.EJ2.Blazor.Schedule
@using Syncfusion.EJ2.Blazor.Calendars
@using Syncfusion.EJ2.Blazor.Inputs
<EjsSchedule TValue="AppointmentData" ModelType="@Model" Width="100%" Height="650px" SelectedDate="@(new DateTime(2019, 1, 31))">
<ScheduleTemplates>
<EditorTemplate>
<table class="custom-event-editor" width="100%" cellpadding="5">
<tbody>
<tr>
<td class="e-textlabel">Summary</td>
<td colspan="4">
<EjsTextBox Id="Subject" CssClass="e-field e-input" Value="@((context as TemplateArgs).Subject)"></EjsTextBox>
</td>
</tr>
<tr>
<td class="e-textlabel">From</td>
<td colspan="4">
<EjsDateTimePicker ID="StartTime" HtmlAttributes="@StartName" CssClass="e-field" Value="@((context as TemplateArgs).StartTime)"></EjsDateTimePicker>
</td>
</tr>
<tr>
<td class="e-textlabel">To</td>
<td colspan="4">
<EjsDateTimePicker ID="EndTime" HtmlAttributes="@EndName" CssClass="e-field" Value="@((context as TemplateArgs).EndTime)"></EjsDateTimePicker>
</td>
</tr>
</tbody>
</table>
</EditorTemplate>
</ScheduleTemplates>
<ScheduleEvents TValue="AppointmentData" ActionCompleted="OnActionCompleted"></ScheduleEvents>
<ScheduleEventSettings TValue="AppointmentData" DataSource="@DataSource">
</ScheduleEventSettings>
</EjsSchedule>
@code {
List<AppointmentData> DataSource = new List<AppointmentData>
{
new AppointmentData { Id = 1, Subject = "Meeting", StartTime = new DateTime(2019, 1, 31, 9, 30, 0), EndTime = new DateTime(2019, 1, 31, 11, 0, 0) },
};
Dictionary<string, object> StartName = new Dictionary<string, object>()
{
{"data-name","StartTime"},
};
Dictionary<string, object> EndName = new Dictionary<string, object>()
{
{"data-name","EndTime"},
};
public void OnActionCompleted(ActionEventArgs<AppointmentData> args)
{
if (args.RequestType == "eventCreated" && args.AddedRecords != null)
{
// will trigger when we create new appointments
}
if (args.RequestType == "eventChanged" && args.ChangedRecords != null)
{
//will trigger when we edit the existing appointments
}
}
public TemplateArgs Model = new TemplateArgs();
public class TemplateArgs
{
public string Subject { get; set; }
public DateTime? StartTime { get; set; }
public DateTime? EndTime { get; set; }
}
public class AppointmentData
{
public int Id { get; set; }
public string Subject { get; set; }
public DateTime StartTime { get; set; }
public DateTime EndTime { get; set; }
}
} |
<tr>
<td class="e-textlabel">Art</td>
<td colspan="4">
<EjsRadioButton @ref="RadioRef1" Label="@BestellferienFarbe.typ" Name="farbe" Value="@BestellferienFarbe.typ" Checked="@((context as LieferantenTermin).FarbId==FarbEnumerator.BESTELLFERIEN)"></EjsRadioButton>
<EjsRadioButton @ref="RadioRef2" Label="@LieferantenferienFarbe.typ" Name="farbe" Value="@LieferantenferienFarbe.typ" Checked="@((context as LieferantenTermin).FarbId==FarbEnumerator.LIEFERANTENFERIEN)"></EjsRadioButton>
</td>
</tr>
…..
EjsRadioButton RadioRef1;
EjsRadioButton RadioRef2;
public void PopupClose(PopupCloseEventArgs<LieferantenTermin> args)
{
if (args.Data != null)
{
args.Data.Anmerkung = RadioRef1.Checked ? RadioRef1.Value : RadioRef2.Value ;
}
} |
<ScheduleTemplates>
<EditorTemplate>
<table class="custom-event-editor" width="100%" cellpadding="5">
<tbody>
<tr>
<td class="e-textlabel">Beschreibung</td>
<td colspan="4">
<EjsTextBox HtmlAttributes="@Subject" CssClass="e-field e-input" Value="@((context as LieferantenTermin).Bezeichnung)"></EjsTextBox>
</td>
</tr>
<tr>
<td class="e-textlabel">Art</td>
<td colspan="4">
<EjsRadioButton @ref="RadioRef1" Label="@BestellferienFarbe.typ" Name="farbe" Value="@BestellferienFarbe.typ" Checked="@((context as LieferantenTermin).FarbId==FarbEnumerator.BESTELLFERIEN)"></EjsRadioButton>
<EjsRadioButton @ref="RadioRef2" Label="@LieferantenferienFarbe.typ" Name="farbe" Value="@LieferantenferienFarbe.typ" Checked="@((context as LieferantenTermin).FarbId==FarbEnumerator.LIEFERANTENFERIEN)"></EjsRadioButton>
</td>
</tr>
<tr>
<td class="e-textlabel">Anfang</td>
<td colspan="4">
<EjsDatePicker HtmlAttributes="@StartName" CssClass="e-field" Value="@((context as LieferantenTermin).Startzeit)"></EjsDatePicker>
</td>
</tr>
<tr>
<td class="e-textlabel">Ende</td>
<td colspan="4">
<EjsDatePicker HtmlAttributes="@EndName" CssClass="e-field" Value="@((context as LieferantenTermin).Endzeit)"></EjsDatePicker>
</td>
</tr>
</tbody>
</table>
</EditorTemplate>
</ScheduleTemplates>
…
Dictionary<string, object> Subject = new Dictionary<string, object>()
{
{"Name","Bezeichnung"},
{"data-name","Bezeichnung"}
};
Dictionary<string, object> StartName = new Dictionary<string, object>()
{
{"Name","Startzeit"},
{"data-name","Startzeit"}
};
Dictionary<string, object> EndName = new Dictionary<string, object>()
{
{"Name","Endzeit"},
{"data-name","Endzeit"}
}; |