Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
145080 | Jun 5,2019 02:13 PM UTC | Jun 19,2019 04:37 AM UTC | React - EJ 2 | 3 |
![]() |
Tags: Grid |
export class Hierarchy extends SampleBase {
constructor() {
super(...arguments);
this.toolbarSettings = ['Add', 'Edit', 'Delete',
{ text: 'Copy', prefixIcon: 'e-copy', id: 'cpy' },
{ text: 'Attach', prefixIcon: 'e-add', id: 'att' },
];
this.sequenceToolbarSettings = [
{ text: 'Attach', prefixIcon: 'e-link-icon', id: 'att' },
{ text: 'Detach', prefixIcon: 'e-unlink-icon', id: 'det' },
];
this.childGrid = {
dataSource: orderDatas,
queryString: 'EmployeeID',
toolbar: this.sequenceToolbarSettings,
toolbarClick: this.sequenceClickHandler,
. . .
};
}
clickHandler = (args) => {
if(args.item.id =='att'){
let asm = this.grid.getSelectedRecords();
console.log(asm);
return;
}
}
sequenceClickHandler = (args) => {
if(args.item.id =='att'){
var seqGrid = parentsUntil(args.originalEvent.target,"e-grid").ej2_instances[0];
let seq = seqGrid.getSelectedRecords();
console.log(seq);
return;
}
}
render() {
return (<div className='control-pane'>
<div className='control-section'>
<GridComponent dataSource={employeeData} childGrid={this.childGrid}
toolbar={this.toolbarSettings}
toolbarClick={this.clickHandler}
ref={g => this.grid = g}
allowSorting={true}>
<ColumnsDirective>
. . .
</ColumnsDirective>
<Inject services={[DetailRow, Toolbar, Page, Sort]}/>
</GridComponent>
</div>
</div>);
}
}
render(<Hierarchy />, document.getElementById('sample')); |
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.