Hi Sandra,
Greetings from Syncfusion Support.
We checked your requirement “Not able to collect the data when create an event” at our end and we suspect that you want to show the virtual events in Grid component that needs to be displayed in the editor template window. So we prepared the sample to show the virtual events in the Grid while opening the Editor window. Please refer to the below code snippet and attached sample for more reference.
Create the template with Grid control
var editorTemplateVue = Vue.component("editorTemplate", {
template: `<table class="custom-event-editor" width="100%" cellpadding="5">
<tbody>
<tr>
<td class="e-textlabel">Summary</td>
<td colspan="4">
<input id="Subject" class="e-field e-input" type="text" value="" name="Subject" style="width: 100%" />
</td>
</tr>
<tr>
<td class="e-textlabel">From</td>
<td colspan="4">
<input id="StartTime" class="e-field" type="text" name="StartTime" />
</td>
</tr>
<tr>
<td class="e-textlabel">To</td>
<td colspan="4">
<input id="EndTime" class="e-field" type="text" name="EndTime" />
</td>
</tr>
<tr>
<td class="e-textlabel">Owner</td>
<td colspan="4">
<input type="text" id="OwnerId" name="OwnerId" class="e-field" style="width: 100%" />
</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" style="width: 100%; height: 60px !important; resize: vertical"></textarea>
</td>
</tr>
<tr>
<td>Virtual Events</td>
<td>
<ejs-grid :allowPaging="true">
<e-columns>
<e-column field='Id' headerText='Id' width=40></e-column>
<e-column field='Subject' headerText='Subject' ></e-column>
<e-column field='StartTime' headerText='From' ></e-column>
<e-column field='EndTime' headerText='To'></e-column>
<e-column field='Name' headerText='Name'></e-column>
</e-columns>
</ejs-grid>
</td>
</tr>
</tbody>
</table>`,
Virtual Events:
data: [
{
Id: 1,
Subject: "Workflow Analysis",
StartTime: new Date(2018, 3, 1, 9, 30),
EndTime: new Date(2018, 3, 1, 12, 0),
IsAllDay: false,
OwnerId: 2,
Name: "Smith"
},
{
Id: 2,
Subject: "Requirement planning",
StartTime: new Date(2018, 3, 1, 12, 30),
EndTime: new Date(2018, 3, 1, 14, 45),
IsAllDay: false,
OwnerId: 1,
Name: "Nancy"
},
{
Id: 3,
Subject: "Quality Analysis",
StartTime: new Date(2018, 3, 2, 10, 0),
EndTime: new Date(2018, 3, 2, 12, 30),
IsAllDay: false,
OwnerId: 3,
Name: "Paul"
},
{
Id: 4,
Subject: "Resource planning",
StartTime: new Date(2018, 3, 2, 13, 0),
EndTime: new Date(2018, 3, 2, 15, 30),
IsAllDay: false,
OwnerId: 2,
Name: "Smith"
}
]
Load the data to Grid on opupOpen Event.
onPopupOpen: function(args) {
if (args.type === "Editor") {
let startElement = args.element.querySelector("#StartTime");
if (!startElement.classList.contains("e-datetimepicker")) {
new DateTimePicker(
{ value: new Date(startElement.value) || new Date() },
startElement
);
}
let endElement = args.element.querySelector("#EndTime");
if (!endElement.classList.contains("e-datetimepicker")) {
new DateTimePicker(
{ value: new Date(endElement.value) || new Date() },
endElement
);
}
let processElement = args.element.querySelector("#OwnerId");
if (!processElement.classList.contains("e-multiselect")) {
let multiSelectObject = new MultiSelect({
placeholder: "Choose a owner",
fields: { text: "text", value: "id" },
dataSource: this.ownerDataSource,
value: [args.data.OwnerId]
});
multiSelectObject.appendTo(processElement);
}
args.element.querySelector(
".e-grid"
).ej2_instances[0].dataSource = this.data;
}
}
},
Output
Kindly check the above and get back to us if you need any further assistance.
Regards,
Vengatesh