Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
144520 | May 10,2019 12:10 AM UTC | May 13,2019 09:39 AM UTC | React - EJ 2 | 1 |
![]() |
Tags: Grid |
[index.js]
import { render } from 'react-dom';
import './index.css';
import * as React from 'react';
import { GridComponent, Grid, ColumnsDirective, ColumnDirective, Toolbar, ColumnChooser, Inject, Page } from '@syncfusion/ej2-react-grids';
import { data } from './data';
import { SampleBase } from './sample-base';
export class ColChooser extends SampleBase {
dataBound(){
this.selectedRowIndices = [1,2,4];
this.gridInstance.selectRows(this.selectedRowIndices);
}
constructor() {
super(...arguments);
this.settings = { mode: 'Row', type: 'Multiple'};
}
render() {
return (<div className='control-pane'>
<div className='control-section'>
<GridComponent dataSource={data} ref={grid =>
this.gridInstance = grid} dataBound={this.dataBound.bind(this)} allowPaging={true} selectionSettings={this.settings} >
<ColumnsDirective>
-----
</ColumnsDirective>
<Inject services={[Page]} />
</GridComponent>
</div>
</div>);
}
}
|
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.