import { render } from 'react-dom';
import './index.css';
import * as React from 'react';
import { GridComponent, ColumnsDirective, ColumnDirective, Page, Toolbar, Inject } from '@syncfusion/ej2-react-grids';
import { categoryData } from './data';
import { SampleBase } from './sample-base';
export class Searching extends SampleBase {
constructor() {
super(...arguments);
this.toolbarOptions = ['Search'];
}
dataBound() {
const proxy = this;
this.element.querySelector('#' + this.element.getAttribute('id') + '_searchbar').addEventListener('keyup', function(e){
this.closest('.e-grid').ej2_instances[0].search(this.value);
});
}
render() {
return (<div className='control-pane'>
<div className='control-section row'>
<GridComponent dataSource={categoryData} toolbar={this.toolbarOptions} dataBound={this.dataBound} allowPaging={true}>
. ..
. . . .
<Inject services={[Toolbar, Page]}/>
</GridComponent>
</div>
</div>);
}
}
render(<Searching />, document.getElementById('sample')); |