|
<ejs-grid #batchgrid id='Batchgrid' [dataSource]='data' allowPaging='true' [pageSettings]='pageSettings' [editSettings]='editSettings' [toolbar]='toolbar' (batchCancel)='batchCancel($event)'>
<e-columns>
--------------
</e-columns>
</ejs-grid>
----------------------------------------------------------------
batchCancel(args: any) :void {
this.grid.clearSelection();
var focusElement = this.grid.element.querySelectorAll(".e-focus")[0];
focusElement.classList.remove("e-focus");
this.grid.element.focus();
} |
Hi Dileep,
Thanks for contacting Syncfusion support.
Based on your query you need to remove focus of the cell when you click on “Ok” button in the confirmation dialog(Cancel the batch edit operation). By default in EJ2 Grid the last cell will be focused when the user cancel the edit operation.
If you want to remove the last focus, we suggest you to use the batchCancel event of EJ2 Grid. This event will be triggered when cancel the batch edit changes. In the batchCancel event, we removed the focus from the last cell and focus the grid element.
For more information please refer the below code example and sample:
<ejs-grid #batchgrid id='Batchgrid' [dataSource]='data' allowPaging='true' [pageSettings]='pageSettings' [editSettings]='editSettings' [toolbar]='toolbar' (batchCancel)='batchCancel($event)'><e-columns>--------------</e-columns></ejs-grid>
----------------------------------------------------------------batchCancel(args: any) :void {this.grid.clearSelection();var focusElement = this.grid.element.querySelectorAll(".e-focus")[0];focusElement.classList.remove("e-focus");this.grid.element.focus();}
Regards,Vignesh Sivagnanam