xport class NormalEdit extends SampleBase {
constructor() {
super(...arguments);
this.toolbarOptions = ['Add', 'Edit', 'Delete', 'Update', 'Cancel'];
this.editSettings = {
allowEditing: true,
allowAdding: true,
allowDeleting: true,
newRowPosition: 'Top',
};
this.editparams = {
params: { popupHeight: '300px', change: this.dropdownChange.bind(this) },
};
this.validationRule = { required: true };
this.orderidRules = { required: true, number: true };
this.pageSettings = { pageCount: 5 };
this.format = { type: 'dateTime', format: 'M/d/y hh:mm a' };
}
dropdownChange(args) {
console.log(args);
}
actionBegin(args) {}
render() {
return (
<div className="control-pane">
<div className="control-section">
<div className="col-md-9">
<GridComponent
dataSource={orderDataSource}
ref={(grid) => (this.gridInstance = grid)}
toolbar={this.toolbarOptions}
allowPaging={true}
editSettings={this.editSettings}
pageSettings={this.pageSettings}
actionBegin={this.actionBegin.bind(this)}
>
<ColumnsDirective>
------------------
------------------
<ColumnDirective
field="ShipCountry"
headerText="Ship Country"
width="150"
editType="dropdownedit"
edit={this.editparams}
></ColumnDirective>
</ColumnsDirective>
<Inject services={[Page, Toolbar, Edit]} />
</GridComponent>
</div>
</div>
</div>
);
}
}
|