|
class App extends Component<AppProps, AppState> {
public editOptions: EditSettingsModel = { allowAdding: true, allowDeleting: true, allowEditing: true };
public toolbarOptions: ToolbarItems[] = ['Add', 'Edit', 'Delete', 'Update', 'Cancel'];
public countryParams : IEditCell = {
params: {
actionComplete: () => false,
allowFiltering: true,
dataSource: new DataManager([
{ countryName: 'United States', countryId: '1' },
{ countryName: 'Australia', countryId: '2' },
{ countryName: 'India', countryId: '3' }
]),
fields: { text: "countryName", value: "countryName"},
query: new Query()
}
};
public grid: Grid | null;
render() {
return (
<div className='control-pane'>
<div className='control-section'>
<GridComponent id='grid' dataSource={cascadeData} editSettings={this.editOptions}
toolbar={this.toolbarOptions} height={273} ref={g => this.grid = g}>
<ColumnsDirective>
. . . . . . . . . .
<ColumnDirective field='ShipCountry' headerText='Ship Country' width='150' editType= 'dropdownedit' edit={this.countryParams}></ColumnDirective>
</ColumnsDirective>
<Inject services={[Edit, Toolbar]} />
</GridComponent>
</div>
</div>
);
}
}
render(<App />, document.getElementById('root'), document.getElementById('button') );
|