<ejs-grid #grid [dataSource]='data' [allowPaging]='true' [pageSettings]="pageSettings" [allowFiltering]='true'
[filterSettings]="filterSettings" [editSettings]='editOptions' [toolbar]='toolbarItems' [allowSorting]='true'>
<e-columns>
<e-column field='OrderID' headerText='Order ID' width='120' textAlign='Right' [validationRules]='orderidrules'
isPrimaryKey='true'></e-column>
<e-column field='CustomerID' headerText='Customer Name' width='250' foreignKeyValue='ContactName'
foreignKeyField='CustomerID' [edit]='dpParams' editType='dropdownedit' [dataSource]='customerData'></e-column>
</e-columns>
</ejs-grid>
|
export class AppComponent {
public ngOnInit(): void {
. . . . .
this.dpParams = { params:{
// you can customize the template based on your requirement
itemTemplate: '<div><img class="empImage" src="https://ej2.syncfusion.com/demos/src/grid/images/1.png" alt="employee"/>' + '<div class="ename"> ${ContactName} </div></div>'}}
}
}
|