Hi Jayjit,
Greetings from Syncfusion support.
Thanks for your patience.
We have analyzed the reported query at our end.
Using the property "Column Template and Cell Edit Template," we have achieved your icon maintenance requirement in edit mode.
Here we have changed the text by clicking the icon using click event and the modified text value will be stored in the database grid using actionBegin event.
You can bind text box change event and customize it according to your requirement.
Please refer this below code example.
[app.component.html]
<e-column field='OrderDate' headerText='Order Date' width=100>
<ng-template #editTemplate let-data>
<div class="image">
<input id="inp{{data.OrderID}}" class="e-input" name='input' type="text" value={{data.CustomerID}}/>
<span class="e-icons e-upload" (click)="changeText($event)"></span>
</div>
</ng-template>
<ng-template #template let-data>
<div class="image">
<input id="inp{{data.OrderID}}" class="e-input" name='input' type="text" value={{data.CustomerID}}/>
<span class="e-icons e-upload" (click)=" changeText($event)"></span>
</div>
</ng-template>
</e-column>
|
[app.component.ts]
changeText(args): void {
var inputId = args.target.previousElementSibling.id;
(document.getElementById(inputId) as HTMLInputElement).value = "Changed";
}
actionBegin(args){
if(args.requestType === 'save'){
args.data.CustomerID = (document.getElementById('inp'+ args.data[this.grid.getPrimaryKeyFieldNames()[0]])as HTMLInputElement).value;
}
} |
Refer the help documentation:
Please check the sample link. If your requirement is not met, kindly return to us if you need any help on this.
Regards,
Thiyagu S