I'm trying to insert dropdown in grid which is bound to external collection (other visual collection on screen), there is an error where not all collection items are loaded into dropdown.. I'm only seeing results for items that already present on screen..
- It is add/edit screen for Orders..
- On the same screen there is a ejGrid with Order details loaded for specific order (in batch mode)..
- In Order detail row there is a dropdown for Product and on screen is added query named Productscol..
- This works until edit mode, when dropdown is displayed for editing I can see SOME Products -> and only Products which are loaded into this and other Order details, so if I have an Order with Order Details for Banana, Apple, Milk and Butter, only that items will be shown in single dropdown respectively..
I saw other posts where people have an issue with binding to other collections from ejGrid but I'm unaware of status if this is resolved or..
myapp.AddEditOrdersSF.OrderDetails1_render = function (element, contentItem) {
// Template
var itemTemplate = $("
").attr('id', 'OrderDetails1')
// Append the div element to screen
itemTemplate.appendTo($(element));
// Productscol is a screen query, and I can see results in drpsr
var drpsr = contentItem.parent.screen.Productscol.data;
contentItem.value.oncollectionchange = function () {
if (itemTemplate.hasClass('e-grid')) {
itemTemplate.ejGrid('destroy');
}
itemTemplate.ejGrid(
{
dataSource: contentItem.value.data,
editSettings: {
allowEditing: true,
allowAdding: true,
allowDeleting: true
},
toolbarSettings: {
showToolbar: true,
toolbarItems: [ej.Grid.ToolBarItems.Add, ej.Grid.ToolBarItems.Edit, ej.Grid.ToolBarItems.Delete, ej.Grid.ToolBarItems.Update, ej.Grid.ToolBarItems.Cancel]
},
columns: [
{ field: "Id", isPrimaryKey: true, headerText: "ID" },
{ field: "Order.Order_no", headerText: 'Order' },
//items shown in dropdown are items loaded in other OrderDetails, not all collection which is "present" in drpsr
{ field: "Product.Name", headerText: 'Product', editType: ej.Grid.EditingType.Dropdown, datasource: drpsr },
{ field: "Product.Code", headerText: 'Product code' },
{ field: "Price", headerText: 'Product_price', width: 90 },
{ field: "Tax", headerText: 'Tax', width: 90 },
{ field: "Quantity", headerText: 'Quantity', width: 90 },
],
});
}
}