function onPopupOpen(args) {
if (args.type === 'Editor') {
var dataRoutes = ej.data.DataManager({ url: "Routes/LoadData", adaptor: "UrlAdaptor" }); // give like this
if (args.type === 'Editor') {
if (!args.element.querySelector('.custom-field-row')) {
var row = ej.base.createElement('div', { className: 'custom-field-row' });
var formElement = args.element.querySelector('.e-schedule-form');
formElement.firstChild.insertBefore(row, args.element.querySelector('.e-title-location-row'));
var container = ej.base.createElement('div', { className: 'custom-field-container' });
var inputRoute = ej.base.createElement('input', {
className: 'e-field', attrs: { name: 'Route' }
});
container.appendChild(inputRoute);
row.appendChild(container);
var ddlRoutes = new ej.dropdowns.DropDownList({
dataSource: dataRoutes,
fields: { text: 'Name', value: 'RouteID' },
floatLabelType: 'Always', placeholder: 'Route'
});
ddlRoutes.appendTo(inputRoute);
inputRoute.setAttribute('name', 'Route');
}
}
}
} |
function onPopupOpen(args) {
if (args.type === 'Editor') {
var dataRoutes = new ej.data.DataManager({ url: 'https://ej2services.syncfusion.com/production/web-services/api/Employees', adaptor: "WebApiAdaptor" , crossDomain: true });
var statusElement = args.element.querySelector('#EmployeeId');
if (!statusElement.classList.contains('e-dropdownlist')) {
var dropDownListObject = new ej.dropdowns.DropDownList({
placeholder: 'Choose status', value: args.data.EmployeeId,
dataSource: dataRoutes,
query: new ej.data.Query(),
fields: { text:"FirstName", value:"EmployeeID" }
});
dropDownListObject.appendTo(statusElement);
statusElement.setAttribute('name', 'EmployeeId');
}
var startElement = args.element.querySelector('#StartTime');
if (!startElement.classList.contains('e-datetimepicker')) {
new ej.calendars.DateTimePicker({ value: new Date(startElement.value) || new Date() }, startElement);
}
var endElement = args.element.querySelector('#EndTime');
if (!endElement.classList.contains('e-datetimepicker')) {
new ej.calendars.DateTimePicker({ value: new Date(endElement.value) || new Date() }, endElement);
}
}
};
|
function onPopupOpen(args) {
var dataRoutes = new ej.data.DataManager({ url: 'Routes/LoadData', adaptor: new ej.data.UrlAdaptor(), crossDomain: true });
if (args.type === 'Editor') {
if (!args.element.querySelector('.custom-field-row')) {
var row = ej.base.createElement('div', { className: 'custom-field-row' });
var formElement = args.element.querySelector('.e-schedule-form');
formElement.firstChild.insertBefore(row, args.element.querySelector('.e-title-location-row'));
var container = ej.base.createElement('div', { className: 'custom-field-container' });
var inputRoute = ej.base.createElement('input', {
className: 'e-field', attrs: { name: 'Route' }
});
container.appendChild(inputRoute);
row.appendChild(container);
var ddlRoutes = new ej.dropdowns.DropDownList({
dataSource: dataRoutes,
fields: { text: 'Name', value: 'RouteID' },
floatLabelType: 'Always', placeholder: 'Route'
});
ddlRoutes.appendTo(inputRoute);
inputRoute.setAttribute('name', 'Route');
}
}
} |
Hi Brad,
We are happy that our solution fulfilled
your requirements.
Regards,
Karthi