Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
147292 | Sep 5,2019 10:57 AM UTC | Jan 27,2020 04:26 PM UTC | Blazor | 18 |
![]() |
Tags: Scheduler |
<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">Status</td>
<td colspan="4">
<EjsDropDownList ID="EventType" DataSource="@StatusData" Placeholder="Choose status" CssClass="e-field" Value="@((context as TemplateArgs).EventType)" HtmlAttributes="@eventType">
<DropDownListFieldSettings Value="id"></DropDownListFieldSettings>
</EjsDropDownList>
</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>
<tr>
<td class="e-textlabel">Reason</td>
<td colspan="4">
<textarea id="Description" class="e-field e-input" name="Description" rows="3" cols="50" value="@((context as TemplateArgs).Description)"
style="width: 100%; height: 60px !important; resize: vertical"></textarea>
</td>
</tr>
</tbody>
</table>
</EditorTemplate>
</ScheduleTemplates> |
<EjsDialog @bind-Visible="@DlgVisible" IsModal="true" @ref="DialogObj" Height="270px" Width="500px" ShowCloseIcon="true">
<DialogTemplates>
<Header> <div>Editor Window </div> </Header>
<Content>
<EditForm Model="appointmentValidation" OnValidSubmit="@OnValidSubmit">
<DataAnnotationsValidator />
<ValidationSummary />
<table class="custom-event-editor" width="100%" cellpadding="5">
<tbody>
<tr>
<td class="e-textlabel">Summary</td>
<td colspan="4">
<EjsTextBox @ref="SubjectObj" @bind-Value="@appointmentValidation.Subject"></EjsTextBox>
<ValidationMessage For="@(() => appointmentValidation.Subject)" />
</td>
</tr>
<tr>
<td class="e-textlabel">From</td>
<td colspan="4">
<EjsDateTimePicker @ref="StartTimeObj" ID="Start" @bind-Value="@appointmentValidation.StartTime"></EjsDateTimePicker>
<ValidationMessage For="@(() => appointmentValidation.StartTime)" />
</td>
</tr>
<tr>
<td class="e-textlabel">To</td>
<td colspan="4">
<EjsDateTimePicker @ref="EndTimeObj" ID="End" @bind-Value="@appointmentValidation.EndTime"></EjsDateTimePicker>
<ValidationMessage For="@(() => appointmentValidation.EndTime)" />
</td>
</tr>
<tr>
<td class="e-textlabel">Grappes</td>
<td colspan="4">
<EjsDropDownList @bind-Value="appointmentValidation.IdGrappeSys" ID="IdSalleExamenSys" DataSource="@salleExamen" Placeholder="Sélectionner la salle">
<DropDownListFieldSettings Value="id" Text="text"></DropDownListFieldSettings>
</EjsDropDownList>
<ValidationMessage For="@(() => appointmentValidation.IdGrappeSys)" />
</td>
</tr>
<tr>
<td class="e-textlabel">SalleExamens</td>
<td colspan="4">
<EjsDropDownList @bind-Value="appointmentValidation.IdSalleExamenSys" ID="IdTypeConsultation" Placeholder="Sélectionner la spécialité" DataSource="@typeConsList" AllowFiltering=true IgnoreAccent=true>
<DropDownListFieldSettings Value="id" Text="text"></DropDownListFieldSettings>
</EjsDropDownList>
<ValidationMessage For="@(() => appointmentValidation.IdSalleExamenSys)" />
</td>
</tr>
<tr>
<td class="e-textlabel">Reason</td>
<td colspan="4">
<EjsTextBox @ref="DescriptionObj" @bind-Value="@appointmentValidation.Description"></EjsTextBox>
<ValidationMessage For="@(() => appointmentValidation.Description)" />
</td>
</tr>
</tbody>
</table>
<button type="submit">Save</button>
</EditForm>
</Content>
</DialogTemplates>
</EjsDialog>
…..
void OnValidSubmit()
{
DlgVisible = false;
AppointmentData EventData = new AppointmentData();
EventData.Subject = appointmentValidation.Subject;
EventData.EndTime = (DateTime)appointmentValidation.EndTime;
EventData.StartTime = (DateTime)appointmentValidation.StartTime;
EventData.Description = appointmentValidation.Description;
EventData.IdGrappeSys = appointmentValidation.IdGrappeSys;
EventData.IdSalleExamenSys = appointmentValidation.IdSalleExamenSys;
EventData.Id = this.Id;
if (this.Action == "CellClick")
{
this.ScheduleObj.AddEvent(EventData); //to add new appointment
}
else
{
this.ScheduleObj.SaveEvent(EventData); // to save the existing appointment
}
validationStatus = "Success!";
} |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.