|
export class BatchEdit extends SampleBase {
constructor() {
super(...arguments);
this.toolbarOptions = ['Add', 'Delete', 'Update', 'Cancel'];
this.editSettings = { allowEditing: true, allowAdding: true, allowDeleting: true, mode: 'Batch' };
this.editparams = { params: { popupHeight: '300px' } };
this.validationRule = { required: true };
this.orderidRules = { required: true, number: true };
this.pageSettings = { pageCount: 5 };
}
render() {
return (<div className='control-pane'>
<div className='control-section'>
<div className='col-md-9'>
<GridComponent dataSource={data} pageSettings={this.pageSettings} toolbar={this.toolbarOptions} allowPaging={true} editSettings={this.editSettings}>
<ColumnsDirective>
<ColumnDirective field='OrderID' headerText='Order ID' width='120' textAlign='Right' validationRules={this.orderidRules} isPrimaryKey={true}></ColumnDirective>
<ColumnDirective field='CustomerName' headerText='Customer Name' width='150' validationRules={this.validationRule}></ColumnDirective>
<ColumnDirective field='Freight' headerText='Freight' width='120' format='C2' textAlign='Right' editType='numericedit'></ColumnDirective>
<ColumnDirective field='OrderDate' headerText='Order Date' editType='datepickeredit' format='yMd' width='170'></ColumnDirective>
<ColumnDirective field='ShipCountry' headerText='Ship Country' width='150' editType='dropdownedit' edit={this.editparams}></ColumnDirective>
</ColumnsDirective>
<Inject services={[Page, Toolbar, Edit]}/>
</GridComponent>
</div>
</div>
</div>);
}
} |