Hi Jason,
Thanks for contacting Syncfusion support.
Query: I am looking at a list of "transactions" that are classified by "Discipline". The dataset for the Grid will not have ALL of the disciplines to choose from when editing a transactions. So, I need to pull in the full list from a remote API (not using DataManager) and provide the full list of disciplines to the drop downs being displayed on the dialog.
Based on your query you want to bind custom dataSource for dropdown component which is rendered in the Dialog edit mode. So, we have prepared sample and in that sample we have used the EditTemplate and bound the custom dataSource for the Dropdown component using the created event of the DropDownList.
In the created event, we have fetched the data from API service and bounded the fetched data in the dropdown component. For your convenience we have attached the sample, please refer them for your reference.
Code Example:
App.component.ts
created() {
const baseURL =
var ajax = new Ajax({
type: "GET",
url: baseURL,
contentType: "application/json",
dataType: "json"
});
ajax
.send()
.then(data => {
let drp = (document.getElementById("ShipCountry") as any)
.ej2_instances[0];
drp.dataSource = this.data; // set datasource and value here
drp.value = this.orderData["ShipCountry"];
drp.dataBind();
})
.catch(xhr => {});
}
}
|
Please get back to us if you need further assistance.
Regards,
Ajith G.