1
1
import * as ReactDOM from 'react-dom' ;
2
2
import * as React from 'react' ;
3
- import { GridComponent , ColumnsDirective , ColumnDirective , Resize , Group , Sort , ContextMenu , Filter , Page , ExcelExport , PdfExport , Edit , Inject } from '@syncfusion/ej2-react-grids' ;
3
+ import { GridComponent , ColumnsDirective , ColumnDirective , Resize , Sort , ContextMenu , Filter , Page , ExcelExport , PdfExport , Edit , Inject } from '@syncfusion/ej2-react-grids' ;
4
4
import { GroupSettingsModel , FilterSettingsModel , ContextMenuItem , EditSettingsModel } from '@syncfusion/ej2-react-grids' ;
5
5
import { data } from './data' ;
6
6
import { SampleBase } from '../common/sample-base' ;
7
7
import './gridcontextmenu.css' ;
8
8
9
9
export class ContextMenuSample extends SampleBase < { } , { } > {
10
10
public groupOptions : GroupSettingsModel = { showGroupedColumn : true } ;
11
- public contextMenuItems : ContextMenuItem [ ] = [ 'sortAscending ' , 'sortDescending' , 'group' , 'ungroup ',
12
- 'autoFit ' , 'autoFitAll ' , 'copy' , 'edit' , 'delete' , 'save' , 'cancel ',
13
- 'pdfExport' , 'excelExport' , 'csvExport' , 'firstPage' , 'prevPage' ,
11
+ public contextMenuItems : ContextMenuItem [ ] = [ 'autoFit ' , 'autoFitAll ' ,
12
+ 'sortAscending ' , 'sortDescending ' , 'copy' , 'edit' , 'delete' , 'save' ,
13
+ 'cancel' , ' pdfExport', 'excelExport' , 'csvExport' , 'firstPage' , 'prevPage' ,
14
14
'lastPage' , 'nextPage' ] ;
15
15
public editing : EditSettingsModel = { allowDeleting : true , allowEditing : true }
16
16
render ( ) {
17
17
return (
18
18
< div className = 'control-pane' >
19
19
< div className = 'control-section' >
20
- < GridComponent id = 'gridcomp' dataSource = { data . splice ( 0 , 60 ) } allowPaging = { true } allowGrouping = { true } allowSorting = { true }
21
- groupSettings = { this . groupOptions } allowExcelExport = { true } allowPdfExport = { true } contextMenuItems = { this . contextMenuItems }
20
+ < GridComponent id = 'gridcomp' dataSource = { data . splice ( 0 , 60 ) } allowPaging = { true } allowSorting = { true }
21
+ allowExcelExport = { true } allowPdfExport = { true } contextMenuItems = { this . contextMenuItems }
22
22
editSettings = { this . editing } >
23
23
< ColumnsDirective >
24
24
< ColumnDirective field = 'OrderID' headerText = 'Order ID' width = '200' textAlign = 'right' isPrimaryKey = { true } > </ ColumnDirective >
@@ -28,13 +28,14 @@ export class ContextMenuSample extends SampleBase<{}, {}> {
28
28
< ColumnDirective field = 'ShipName' headerText = 'Ship Name' width = '200' > </ ColumnDirective >
29
29
< ColumnDirective field = 'ShipCountry' headerText = 'Ship Country' width = '200' > </ ColumnDirective >
30
30
</ ColumnsDirective >
31
- < Inject services = { [ Resize , Group , Sort , ContextMenu , Filter , Page , ExcelExport , Edit , PdfExport ] } />
31
+ < Inject services = { [ Resize , Sort , ContextMenu , Filter , Page , ExcelExport , Edit , PdfExport ] } />
32
32
</ GridComponent >
33
33
</ div >
34
34
< div id = "action-description" >
35
- < p > This sample demonstrates the usage of context menu in Grid component. Right click anywhere on the Grid to view context
36
- menu.
37
- </ p >
35
+ < p >
36
+ This sample demonstrates the usage of context menu in Grid component. Right click anywhere on the Grid to view context
37
+ menu.
38
+ </ p >
38
39
</ div >
39
40
< div id = "description" >
40
41
< p >
@@ -43,7 +44,7 @@ export class ContextMenuSample extends SampleBase<{}, {}> {
43
44
< code > < a target = "_blank" className = "code"
44
45
href = "http://ej2.syncfusion.com/react/documentation/grid/api-gridComponent.html#contextmenuitems-contextmenuitem---contextmenuitemmodel" > contextMenuItems
45
46
</ a > </ code > . Each item will be shown based on it target. The default items are
46
- </ p >
47
+ </ p >
47
48
< ul >
48
49
< li >
49
50
< code > edit</ code > - Edit the current record.</ li >
0 commit comments