Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
143183 | Mar 8,2019 01:24 AM UTC | Mar 11,2019 04:07 AM UTC | React - EJ 2 | 3 |
![]() |
Tags: Grid |
export class Grouping extends SampleBase {
constructor() {
super(...arguments);
this.groupOptions = { showGroupedColumn: false, columns: ['Country'],captionTemplate: this.gridTemplate };
}
gridTemplate(props) {
if(props.count ==1){
return (
<span>{props.key} - {props.count} item</span>
);
}else{
return (
<span>{props.key} - {props.count} items</span>
);
}
}
render() {
return (<div className='control-pane'>
<div className='control-section'>
<GridComponent dataSource={inventoryData} allowPaging={true} ref={grid => this.gridInstance = grid} pageSettings={{ pageCount: 5 }} allowGrouping={true} groupSettings={this.groupOptions} allowSorting={true} height="320" >
<ColumnsDirective>
<ColumnDirective field='Inventor' headerText='Inventor Name' width='180'></ColumnDirective>
. . .
</ColumnsDirective>
<Inject services={[Page, Group, Sort]}/>
</GridComponent>
</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.