[index.js]
actionComplete(args){
if(args.requestType == "batchsave"){
document.getElementById("externalbtn").disabled =false // Disabled external button while add and edit actions
}
}
toolBarClick(args){
if(args.item.text === "Add" || args.item.text === "Edit" ){
document.getElementById("externalbtn").disabled =true // Disabled external button while add and edit actions
} else if(args.item.text === "Cancel"){
document.getElementById("externalbtn").disabled =false; // Disabled external button while add and edit actions
}
}
|
[indx.js]
toolBarClick(args){
if(args.item.text === "Add" || args.item.text === "Edit" ){
document.getElementById("externalbtn").disabled =true
} else if(args.item.text === "Cancel"){
document.getElementById("externalbtn").disabled =false;
} else if(args.item.text === "Delete"){
if(this.gridInstance.getSelectedRecords().length>0){
document.getElementById("externalbtn").disabled =true
}
}
}
|
[index.js]
beforeBatchSave(args){
document.getElementById("externalbtn").disabled =false; // trigger before save the changes
}
. . . .
render() {
return (<div className='control-pane'>
<button id="externalbtn" onClick={this.onClick.bind(this)}>External Button</button>
<div className='control-section'>
<GridComponent dataSource={this.data1} ref={grid => this.gridInstance = grid} enableHover={false} allowPaging={true} pageSettings={{ pageCount: 5 }} toolbar={this.toolbarOptions} editSettings={this.editSettings} beforeBatchSave={this.beforeBatchSave.bind(this)} toolbarClick={this.toolBarClick.bind(this)}>
. . . .
</div>
</div>);
|