Skip to content

Commit b2457c7

Browse files
author
pipeline
committed
sample(EJ2-4764): Sorting enabled
1 parent b39a5b1 commit b2457c7

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed
Binary file not shown.
17 Bytes
Binary file not shown.

samples/grid/frozenrows/app/index.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as ReactDOM from 'react-dom';
22
import * as React from 'react';
3-
import { GridComponent, ColumnsDirective, ColumnDirective, Freeze, Inject, Resize } from '@syncfusion/ej2-react-grids';
3+
import { GridComponent, ColumnsDirective, ColumnDirective, Freeze, Inject, Resize, Sort } from '@syncfusion/ej2-react-grids';
44
import { data } from '../data';
55
import { NumericTextBoxComponent } from '@syncfusion/ej2-react-inputs';
66
import { ButtonComponent } from '@syncfusion/ej2-react-buttons';
@@ -23,8 +23,8 @@ export class FrozenRows extends SampleBase<{}, {}> {
2323
return (
2424
<div className='control-pane'>
2525
<div className='control-section'>
26-
<div className=' col-lg-8'>
27-
<GridComponent dataSource={data.slice(0, 50)} height='350' frozenRows={2} frozenColumns={1} allowSelection={false} enableHover={false} allowResizing={true} ref={g => this.grid = g}>
26+
<div className='col-lg-8'>
27+
<GridComponent dataSource={data.slice(0, 50)} height='350' frozenRows={2} frozenColumns={1} allowSelection={false} enableHover={false} allowResizing={true} allowSorting={true} allowMultiSorting={false} ref={g => this.grid = g}>
2828
<ColumnsDirective>
2929
<ColumnDirective field='OrderID' headerText='Order ID' width='120' textAlign='right'></ColumnDirective>
3030
<ColumnDirective field='Freight' headerText='Freight' width='125' format='C2' />
@@ -37,9 +37,9 @@ export class FrozenRows extends SampleBase<{}, {}> {
3737
<ColumnDirective field='ShipCity' headerText='Ship City' width='250'></ColumnDirective>
3838
<ColumnDirective field='ShipCountry' headerText='Ship Country' width='250'></ColumnDirective>
3939
</ColumnsDirective>
40-
<Inject services={[Freeze, Resize]} />
40+
<Inject services={[Freeze, Resize, Sort]} />
4141
</GridComponent>
42-
</div>
42+
</div>
4343
<div className='col-lg-4 property-section'>
4444
<PropertyPane title='Properties'>
4545
<table id="property" title="Properties" className='property-panel-table' style={{ width: '100%' }}>

src/grid/frozenrows.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as ReactDOM from 'react-dom';
22
import * as React from 'react';
3-
import { GridComponent, ColumnsDirective, ColumnDirective, Freeze, Inject, Resize } from '@syncfusion/ej2-react-grids';
3+
import { GridComponent, ColumnsDirective, ColumnDirective, Freeze, Inject, Resize, Sort } from '@syncfusion/ej2-react-grids';
44
import { data } from './data';
55
import { NumericTextBoxComponent } from '@syncfusion/ej2-react-inputs';
66
import { ButtonComponent } from '@syncfusion/ej2-react-buttons';
@@ -23,8 +23,8 @@ export class FrozenRows extends SampleBase<{}, {}> {
2323
return (
2424
<div className='control-pane'>
2525
<div className='control-section'>
26-
<div className=' col-lg-8'>
27-
<GridComponent dataSource={data.slice(0, 50)} height='350' frozenRows={2} frozenColumns={1} allowSelection={false} enableHover={false} allowResizing={true} ref={g => this.grid = g}>
26+
<div className='col-lg-8'>
27+
<GridComponent dataSource={data.slice(0, 50)} height='350' frozenRows={2} frozenColumns={1} allowSelection={false} enableHover={false} allowResizing={true} allowSorting={true} allowMultiSorting={false} ref={g => this.grid = g}>
2828
<ColumnsDirective>
2929
<ColumnDirective field='OrderID' headerText='Order ID' width='120' textAlign='right'></ColumnDirective>
3030
<ColumnDirective field='Freight' headerText='Freight' width='125' format='C2' />
@@ -37,9 +37,9 @@ export class FrozenRows extends SampleBase<{}, {}> {
3737
<ColumnDirective field='ShipCity' headerText='Ship City' width='250'></ColumnDirective>
3838
<ColumnDirective field='ShipCountry' headerText='Ship Country' width='250'></ColumnDirective>
3939
</ColumnsDirective>
40-
<Inject services={[Freeze, Resize]} />
40+
<Inject services={[Freeze, Resize, Sort]} />
4141
</GridComponent>
42-
</div>
42+
</div>
4343
<div className='col-lg-4 property-section'>
4444
<PropertyPane title='Properties'>
4545
<table id="property" title="Properties" className='property-panel-table' style={{ width: '100%' }}>

0 commit comments

Comments
 (0)