<ng-template #editorTemplate let-data>
<table *ngIf="data != undefined" class="custom-event-editor" width="100%" cellpadding="5">
<tbody>
<tr>
<td class="e-textlabel">Summary</td>
<td colspan="4">
<textarea matInput id="Subject" class="e-field e-input" type="text" value="{{data.Subject}}" name="Subject"
style="width: 100%"></textarea>
</td>
</tr>
<tr>
<td class="e-textlabel">Status</td>
<td colspan="4">
<ejs-dropdownlist id='Status' class="e-field" data-name="Status" placeholder='Choose Status'
[dataSource]='StatusData' [fields]='statusFields' value='{{data.Status}}'>
</ejs-dropdownlist>
</td>
</tr>
<tr>
<td class="e-textlabel">Country</td>
<td colspan="4">
<mat-form-field>
<mat-select name="countryVaraible" [(value)]="selectedCountry" placeholder="Country">
<mat-option *ngFor="let country of countries" [value]="country.short">
{{country.full}}
</mat-option>
</mat-select>
</mat-form-field>
</td>
</tr>
<tr>
<td class="e-textlabel">From</td>
<td colspan="4">
<ejs-datetimepicker id="StartTime" class="e-field" data-name="StartTime"
format="M/dd/yy h:mm a" [value]="dateParser(data.startTime || data.StartTime)">
</ejs-datetimepicker>
</td>
</tr>
<tr>
<td class="e-textlabel">To</td>
<td colspan="4">
<ejs-datetimepicker id="EndTime" class="e-field" data-name="EndTime" format="M/dd/yy h:mm a"
[value]='dateParser(data.endTime || data.EndTime)'></ejs-datetimepicker>
</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="{{data.Description}}" style="width: 100%; height: 60px !important; resize: vertical"></textarea>
</td>
</tr>
</tbody>
</table>
</ng-template> |
public onActionBegin(args: any): void {
if (args.requestType === "eventCreate") {
let country = this.countries.filter(
x => x.short == this.selectedCountry
)[0].full;
args.data[0].Country = country;
} else if (args.requestType === "eventChange") {
let country = this.countries.filter(
x => x.short == this.selectedCountry
)[0].full;
args.data.Country = country;
}
}
public onPopupOpen(args: any): void {
if (args.type == "Editor") {
if (args.target.classList.contains("e-work-cells")) {
this.selectedCountry = "";
} else {
this.selectedCountry = this.countries.filter(
x => x.full == args.data.Country
)[0].short;
}
}
} |