import { render } from 'react-dom';
import './index.css';
import * as React from 'react';
import { GridComponent, ColumnsDirective, ColumnDirective, Page, Selection, Inject, Edit, Toolbar } from '@syncfusion/ej2-react-grids';
import { data } from './data';
import { SampleBase } from './sample-base';
export class CheckboxSelection extends SampleBase {
constructor() {
super(...arguments);
this.selectionsettings = { persistSelection: true };
this.toolbarOptions = ['Delete'];
this.editSettings = { allowDeleting: true };
}
rowSelecting() {
this.gridInstance.clearSelection();
}
render() {
return (<div className='control-pane'>
<div className='control-section'>
<GridComponent dataSource={data} ref={grid => this.gridInstance = grid} enableHover={false} allowPaging={true} rowSelecting={this.rowSelecting.bind(this)} pageSettings={{ pageCount: 5 }} selectionSettings={this.selectionsettings} toolbar={this.toolbarOptions} editSettings={this.editSettings}>
</GridComponent>
</div>
</div>);
}
}
render(<CheckboxSelection />, document.getElementById('sample'));
|