|
export class NormalEdit extends SampleBase {
constructor() {
super(...arguments);
this.toolbarOptions = ["Add", "Edit", "Delete", "Update", "Cancel"];
this.format = { type: "dateTime", format: "M/d/y hh:mm a" };
this.droplist = [
{ text: "Top", value: "Top" },
{ text: "Bottom", value: "Bottom" }
];
}
actionBegin(args) {
if (args.requestType === "delete") { //triggers while deleting the record
console.log("actionBegin triggers");
console.log(args.data);
}
if (args.requestType === "save") { //triggers while adding the record
console.log("actionBegin triggers");
console.log(args.data);
}
}
actionComplete(args) {
if (args.requestType === "save") { // triggers when the record was added
console.log("actionComplete triggers");
console.log(args.data);
}
if (args.requestType === "delete") { // triggers when the record was deleted
console.log("actionComplete triggers");
console.log(args.data);
}
}
render() {
return (
<div className="control-pane">
<div className="control-section">
<div className="col-md-9">
<GridComponent
dataSource={orderDataSource}
ref={grid => (this.gridInstance = grid)}
actionBegin={this.actionBegin.bind(this)}
actionComplete={this.actionComplete.bind(this)}
>
<ColumnsDirective>
. . . . . . . . .
. . . . . . . . .
</ColumnsDirective>
<Inject services={[Page, Toolbar, Edit]} />
</GridComponent>
</div>
</div>
</div>
);
}
}
|