|
...
export class NormalEditComponent implements OnInit {
...
public ngOnInit(): void {
this.data = orderDatas;
...
this.ddParamsP= {
create: () => {
this.elem = document.createElement('input');
return this.elem;
},
read: () => {
return this.dropdownObj.text; //return text property value while selected dropdown item
},
destroy: () => {
this.dropdownObj .destroy();
},
write: (args: { rowData: any, column: any }) => {
this.dropdownObj = new DropDownList({
dataSource: <any>orderDatas,
value: (args.rowData as any).OrderID, // set the value property field while editing CustomerID column
fields: { text: 'CustomerID', value: 'OrderID' }
});
this.dropdownObj .appendTo(this.elem);
}
}
this.pageSettings = {pageCount: 5};
}
} |
|
[app.component.html]
<ejs-grid [dataSource]='aProducts' allowPaging='true' height='400' [pageSettings]='pageSettings' [editSettings]='editSettings'>
<e-columns>
<e-column field='name' headerText='Product Name' width='120' textAlign='Right' isPrimaryKey='true' ></e-column>
<e-column field='personageDetailId' foreignKeyValue='name' foreignKeyField ='personageDetailId' [dataSource]='userData' headerText='Product Owner' textAlign='Left' width=90></e-column>
<e-column headerText='Manage Records' width='160' [commands]='commands'></e-column>
</e-columns>
</ejs-grid>
[app.component.ts]
this.aProducts = [
{
name: "Imperva",
ownerPersonageDetailId: 5,
personageDetailId: 5,
syndicateDetailId: 7,
syndicateProductId: 1
}
];
this.userData = [
{
name: "Test Test",
personageDetailId: 5
}
]
|