<div class="control-section">
<ejs-grid [dataSource]='data' height='350'>
<e-columns>
<e-column field='OrderID' headerText='Order ID' width='120' textAlign='Right'></e-column>
<e-column field='CustomerName' headerText='Customer Name' width='150'></e-column>
<e-column field='Freight' headerText='Freight' width='120' format='C2' textAlign='Right'></e-column>
<e-column headerText="Photo" width="90">
<ng-template #template let-data>
<button (click)="clicked(data.OrderID)">{{data.OrderID}}</button>
// use click instead of onclick
<input type="button" (click)="clicked(data.OrderID)" value={{data.OrderID}} />
</ng-template>
</e-column>
</e-columns>
</ejs-grid>
</div>
|
I am not able to trigger the click handler of column template controls. I am following the same as above. Could you please guide ?
[app.component.html]
<ejs-grid [dataSource]='data' height='350'>
<e-columns>
<e-column field='OrderID' headerText='Order ID' width='120' textAlign='Right'></e-column>
<e-column field='CustomerName' headerText='Customer Name' width='150'>
<ng-template #template let-data>
<a (click)="deleteLine(data)" id="id_{{data.CustomerName}}" title="Delete"
rel='nofollow' href="javascript:void(0)">{{data.CustomerName}}</a>
</ng-template>
</e-column>
<e-column field='Freight' headerText='Freight' width='120' format='C2' textAlign='Right'></e-column>
<e-column headerText="Photo" width="90">
<ng-template #template let-data>
<button (click)="clicked(data.OrderID)">{{data.OrderID}}</button>
<input type="button" (click)="clicked(data.OrderID)" value={{data.OrderID}} />
</ng-template>
</e-column>
</e-columns>
</ejs-grid> |