var country = [
{ ShipCountry: 'Germany', countryId: '1' },
{ ShipCountry: 'Brazil', countryId: '3' },
{ ShipCountry: 'France', countryId: '4' },
{ ShipCountry: 'Belgium', countryId: '5' },
{ ShipCountry: 'Switzerland', countryId: '6' },
{ ShipCountry: 'Mexico', countryId: '8' },
{ ShipCountry: 'Austria', countryId: '12' },
{ ShipCountry: 'Spain', countryId: '9' },
{ ShipCountry: 'USA', countryId: '14' },
{ ShipCountry: 'Finland', countryId: '16' },
{ ShipCountry: 'Sweden', countryId: '18' }
];
ej.grids.Grid.Inject(ej.grids.Edit, ej.grids.Toolbar);
var grid = new ej.grids.Grid({
-----
columns: [
{ field: 'ShipCountry', headerText: 'Ship Country', width: 120, editType: 'dropdownedit', edit: {
params: {
query: new ej.data.Query(),
dataSource: country,
fields: { value: 'ShipCountry', text: 'countryId' }, // value must be same as the column field
actionComplete: ()=>false
}
}
}
],
height: 273
});
grid.appendTo('#Grid');
|
params: {
query: new ej.data.Query(), dataSource: data2, fields: { value: "CustomerID", text: "Position" },
value:"A",
width: 300,
showClearButton: true,
}
|