Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
143740 | Apr 3,2019 12:46 PM UTC | Apr 5,2019 11:58 AM UTC | JavaScript - EJ 2 | 3 |
![]() |
Tags: Grid |
var grid = new ej.grids.Grid({
dataSource: window.orderDataSource,
editSettings: { allowEditing: true, allowAdding: true, allowDeleting: true, mode: 'Normal'},
allowPaging: true,
pageSettings: { pageCount: 5 },
toolbar: ['Add', 'Edit', 'Delete', 'Update', 'Cancel'],
actionBegin: actionBegin,
columns: [
{
field: 'OrderID', isPrimaryKey: true, headerText: 'Order ID' validationRules: { required: true, number: true }, width: 140
},
{
field: 'CustomerID', headerText: 'Customer ID',
validationRules: { required: true }, width: 140
},
{
field: 'ShipCountry', headerText: 'Ship Country', editType: 'dropdownedit', width: 150,
edit: { params: { popupHeight: '300px' } }
}
],
});
grid.appendTo('#Grid');
function actionBegin(args) {
if (args.requestType === 'beginEdit') {
if(args.rowData.CustomerID.includes("V")){
// enable and disable editing for shipCountry column
this.columns[2].allowEditing = true;
} else {
this.columns[2].allowEditing = false;
}
}
}
|
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.