var DataManager = new ej.data.DataManager({
// url: url,
url: URI + "api/cseldetail/list",
crudUrl: URI + "api/cseldetail/batch",
// updateUrl: URI + 'api/cseldetail/update',
// insertUrl: URI + 'api/cseldetail/insert',
adaptor: new ej.data.UrlAdaptor(),
// offline: true,
crossDomain: true
});
ej.grids.Grid.Inject(ej.grids.ColumnChooser);
ej.grids.Grid.Inject(ej.grids.ColumnMenu);
ej.grids.Grid.Inject(ej.grids.Edit);
ej.grids.Grid.Inject(ej.grids.ExcelExport);
ej.grids.Grid.Inject(ej.grids.Filter);
ej.grids.Grid.Inject(ej.grids.ForeignKey);
ej.grids.Grid.Inject(ej.grids.Group);
ej.grids.Grid.Inject(ej.grids.Page);
ej.grids.Grid.Inject(ej.grids.Reorder);
ej.grids.Grid.Inject(ej.grids.Resize);
ej.grids.Grid.Inject(ej.grids.RowDD);
ej.grids.Grid.Inject(ej.grids.Search);
ej.grids.Grid.Inject(ej.grids.Selection);
ej.grids.Grid.Inject(ej.grids.Sort);
ej.grids.Grid.Inject(ej.grids.Toolbar);
var grid = new ej.grids.Grid({
dataSource: DataManager,
query: new ej.data.Query().addParams('username', username).addParams('csel_headers_id', header_id),
// enablePersistence: true,
allowPaging: true,
pageSettings: {pageSizes: ['20', '50','All']},
allowSelection: true,
selectionSettings: { type: 'Multiple' },
allowResizing: true,
isResponsive: true,
allowSorting: true,
allowMultiSorting: true,
allowFiltering: true,
filterSettings: { type: 'Excel' },
allowGrouping: true,
allowReordering: true,
showColumnChooser: true,
showColumnMenu: true,
allowExcelExport: true,
allowRowDragAndDrop: true,
height: 700,
rowHeight: 25,
enableAutoFill: true,
groupSettings: {
columns: ['csel_options_categories_id'],
showGroupedColumn: false
},
editSettings: {
allowEditing: true,
allowAdding: true,
mode: 'Batch',
newRowPosition:'Top'
},
sortSettings: {
columns: [
{ field: 'csel_options_categories_id', direction: 'Ascending' },
{ field: 'order', direction: 'Ascending' }
]
},
contextMenuItems: [
'AutoFit', 'AutoFitAll', 'SortAscending', 'SortDescending',
'Copy', 'Edit', 'Save', 'Cancel','FirstPage', 'PrevPage', 'LastPage', 'NextPage'
],
toolbar: ['Add', 'Edit', 'Update', 'Cancel', 'ColumnChooser', 'ExcelExport', 'Search'],