|
[html]
<ej-grid id="Grid" [dataSource]="gridData" [toolbarSettings]="toolbarItems" [editSettings]="editSettings" >
<e-columns>
<e-column field="OrderID" headerText="OrderID" [isPrimaryKey]="true"></e-column>
<e-column field="EmployeeID" headerText="EmployeeID" editType="dropdownedit" [dataSource]="year"></e-column>
<e-column field="Freight" headerText="Freight"></e-column>
<e-column field="ShipCountry" headerText="ShipCountry" ></e-column>
</e-columns>
</ej-grid>
[ts]
export class GridComponent {
public gridData;
public editSettings;
public toolbarItems;
public year = [];
constructor() {
this.gridData = (window as any).gridData;
this.editSettings = { allowEditing: true, allowAdding: true, allowDeleting: true};
this.toolbarItems={ showToolbar : true, toolbarItems : ["add", "edit", "delete", "update", "cancel"]};
for(let i=3010;i<=3018;i++){
this.year.push({text:i,value:i});
}
}
} |