[Parent.js]
import './App.css';
import { ButtonComponent } from '@syncfusion/ej2-react-buttons';
. . . .
class Parent extends React.Component {
constructor(props) {
super(props);
. . . .
};
gridTemplate(props) {
// We have bnd the button on template column
return (<div className='custId'>
<ButtonComponent cssClass='e-primary' content={props.CustomerID} onClick={this.templateBtnClk} ></ButtonComponent>
</div>);
}
columns = [
. . . .
];
templateBtnClk(args) {
// you can bind the Modal pop-up here
}
componentDidMount() {
this.gridInstance.columns[3].template = this.gridTemplate.bind(this); // Define the template column for dynamic columns scenario
}
render() {
return (
<div className="Parent" >
<div className='control-section'>
<GridComponent ref={grid => this.gridInstance = grid} dataSource={orderData} allowFiltering={true} allowPaging={true} allowSorting={true}
toolbar={this.toolbarOptions} allowSelection={true}
editSettings={this.editOptions} columns={this.columns}>
<Inject services={[Filter, Page, Edit, Toolbar, ExcelExport, PdfExport, Sort]} />
</GridComponent>
</div>
</div>
);
}
}
export default Parent;
|
let coldef = {"field":"Included","headerText":"Included","allowEditing":true,"type":"boolean","editType":"booleanedit","displayAsCheckBox":"true"}
|