Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
146821 | Aug 21,2019 02:08 PM UTC | Aug 22,2019 05:42 AM UTC | JavaScript - EJ 2 | 1 |
![]() |
Tags: Grid |
[index.js]
var elem;
var dObj;
var shipCountryData = ["Italy", "Mexico", "Ireland", "USA", "France", "Germany", "UK", "Finland", "Spain", "Sweden"];
var grid = new ej.grids.Grid({
dataSource: window.orderDataSource.splice(0, 20),
editSettings: { allowEditing: true, allowAdding: true, allowDeleting: true, mode: 'Normal', newRowPosition: 'Top' },
allowPaging: true,
pageSettings: { pageSize: 5 },
toolbar: ['Add', 'Edit', 'Delete', 'Update', 'Cancel'],
columns: [
. . . . .
{
field: 'ShipCountry', headerText: 'Ship Country', width: 150,
edit: {
create: function () {
elem = document.createElement('input');
return elem;
},
read: function () {
return dObj.value;
},
destroy: function () {
dObj.destroy();
},
write: function (args) {
dObj = new ej.dropdowns.AutoComplete({
dataSource: shipCountryData,
value: args.rowData["ShipCountry"] ? args.rowData["ShipCountry"] : "",
});
dObj.appendTo(elem);
}
}
}
],
});
|
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.