Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
141835 | Jan 7,2019 09:16 AM UTC | Jan 9,2019 04:09 AM UTC | JavaScript - EJ 2 | 3 |
![]() |
Tags: Grid |
var grid = new ej.grids.Grid({
dataSource: data,
//selectionSettings: { type: 'Multiple' },
showColumnChooser: true,
allowPaging: true,
editSettings: {
allowEditing: true,
allowAdding: true,
allowDeleting: true,
mode: 'Dialog',
showConfirmDialog: true,
showDeleteConfirmDialog: true,
},
allowExcelExport: true,
allowPdfExport: true,
toolbar: ['Add', 'Edit', 'Delete', 'ExcelExport', 'PdfExport'],
columns: [
{ field: 'OrderID', headerText: 'Order ID', textAlign: 'Right', width: 120 },
{ field: 'CustomerID', headerText: 'Customer ID', allowEditing: false, width: 150 },
{ field: 'Freight', width: 150 },
{ field: 'OrderDate', headerText: 'Order Date', width: 150 }
],
height: 315
});
|
var grid = new ej.grids.Grid({
dataSource: data,
//selectionSettings: { type: 'Multiple' },
showColumnChooser: true,
allowPaging: true,
editSettings: {
allowEditing: true,
allowAdding: true,
allowDeleting: true,
mode: 'Dialog',
showConfirmDialog: true,
showDeleteConfirmDialog: true,
},
allowExcelExport: true,
allowPdfExport: true,
toolbar: ['Add', 'Edit', 'Delete', 'ExcelExport', 'PdfExport'],
columns: [
{ field: 'OrderID', headerText: 'Order ID', textAlign: 'Right', width: 120 },
{ field: 'CustomerID', headerText: 'Customer ID', width: 150 },
{ field: 'Freight', width: 150 },
{ field: 'OrderDate', headerText: 'Order Date', width: 150 }
],
actionBegin: function(args){
if(args.requestType == "beginEdit" || args.requestType == 'add')
this.columns[1].visible = false;
else if(args.requestType == "save" || args.requestType == "cancel")
this.columns[1].visible = true;
},
height: 315
});
|
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.