|
<ScheduleTemplates>
<EditorTemplate>
<table class="custom-event-editor" width="100%" cellpadding="5">
<tbody>
<tr>
<td class="e-textlabel">Summary</td>
<td colspan="4">
<SfTextBox ID="Subject" CssClass="e-field e-input" Value="@((context as ScheduleData.AppointmentData).Subject)"></SfTextBox>
</td>
</tr>
<tr>
<td class="e-textlabel">Status</td>
<td colspan="4">
<SfDropDownList ID="EventType" DataSource="@StatusData" Placeholder="Choose status" CssClass="e-field" Value="@((context as ScheduleData.AppointmentData).EventType)" HtmlAttributes="@EventType">
<DropDownListFieldSettings Value="Id"></DropDownListFieldSettings>
</SfDropDownList>
</td>
</tr>
<tr>
<td class="e-textlabel">From</td>
<td colspan="4">
<SfDateTimePicker ID="StartTime" HtmlAttributes="@StartName" CssClass="e-field" Value="@((context as ScheduleData.AppointmentData).StartTime.ToUniversalTime())"></SfDateTimePicker>
</td>
</tr>
<tr>
<td class="e-textlabel">To</td>
<td colspan="4">
<SfDateTimePicker ID="EndTime" HtmlAttributes="@EndName" CssClass="e-field" Value="@((context as ScheduleData.AppointmentData).EndTime.ToUniversalTime())"></SfDateTimePicker>
</td>
</tr>
<tr>
<td colspan="2">
<SfRecurrenceEditor @ref="RecurrenceEditor" Value="@((context as ScheduleData.AppointmentData).RecurrenceRule)"></SfRecurrenceEditor>
</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 ScheduleData.AppointmentData).Description)"
style="width: 100%; height: 60px !important; resize: vertical"></textarea>
</td>
</tr>
</tbody>
</table>
</EditorTemplate>
</ScheduleTemplates> |
|
public void OnEditorClose(PopupCloseEventArgs<ScheduleData.AppointmentData> args)
{
if (args.Data != null && args.Type == PopupType.Editor && RecurrenceEditor != null)
{
args.Data.RecurrenceRule = RecurrenceEditor.Value != null ? RecurrenceEditor.Value.ToString() : "";
}
} |
|
private void OnSelected(Syncfusion.Blazor.DropDowns.ChangeEventArgs<string> e)
{
if (e.IsInteracted)
{
var culture = (string)e.Value;
var uri = new Uri(NavigationManager.Uri)
.GetComponents(UriComponents.PathAndQuery, UriFormat.Unescaped);
var query = $"?culture={Uri.EscapeDataString(culture)}&" +
$"redirectUri={Uri.EscapeDataString(uri)}";
NavigationManager.NavigateTo("/Culture/SetCulture" + query, forceLoad: true);
}
} |
|
.e-recurrenceeditor {
display: none;
} |
|
Previous snippet |
Modified snippet |
|
<SfDropDownList TValue="string"
TItem="Cultures"
DataSource="@CultureList"
Width="143px"
Index="@cultureIndex"
PopupWidth="143px"
CssClass="localization-combo">
<DropDownListEvents TValue="string" ValueChange="OnSelected"></DropDownListEvents>
<DropDownListFieldSettings Value="Code" Text="Text"></DropDownListFieldSettings>
</SfDropDownList>
</div>
@code {
private int cultureIndex { get; set; }
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
switch (System.Globalization.CultureInfo.CurrentCulture.Name)
{
case "en-US":
this.cultureIndex = 0;
break;
case "de":
this.cultureIndex = 1;
break;
case "fr":
this.cultureIndex = 2;
break;
case "ar":
this.cultureIndex = 3;
break;
case "zh":
this.cultureIndex = 4;
break;
}
}
} |
<SfDropDownList TValue="string"
TItem="Cultures"
DataSource="@CultureList"
Width="143px"
@bind-Value="@cultureValue"
PopupWidth="143px"
CssClass="localization-combo">
<DropDownListEvents TValue="string" ValueChange="OnSelected"></DropDownListEvents>
<DropDownListFieldSettings Value="Code" Text="Text"></DropDownListFieldSettings>
</SfDropDownList>
</div>
<style>
.localization-combo {
border-radius: 4px;
border-color: #B3B3B3;
font-family: OpenSans-Regular;
font-size: 12px;
background-color: #FFFFFF;
border-width: 1px;
color: #333333;
}
</style>
@code {
private string cultureValue { get; set; }
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
this.cultureValue = System.Globalization.CultureInfo.CurrentCulture.Name;
}
} |