$("#Grid").ejGrid({
dataSource: window.gridData,
allowPaging: true,
columns:[
{
field: "CustomerID", headerText: 'Customer ID', validationRules: { required: true},
editTemplate: {
create: function () {
return "<input>";
},
read: function (args) {
return args.ejDropDownList("getValue");
},
write: function (args) {//Get ShipCountry column dataSource and bind to the drop down customerID column
var data = ej.DataManager(window.gridData).executeLocal(new ej.Query().select("ShipCountry"));
args.element.ejDropDownList({dataSource: data });
args.element.ejDropDownList("setSelectedText", args.rowdata.ShipCountry);
}
}, width: 90
},
{ field: "EmployeeID", headerText: 'Employee ID', editType: ej.Grid.EditingType.Dropdown, width: 90 },
{ field: "ShipCountry", headerText: 'Ship Country', width: 90, }
]
}); |