How to auto select full text after pressing Enter key when using Batch Editing mode?

Hi Team,

In Grid with Batch Editing.  How to resolve the problem as below?


Thanks,

Linh


3 Replies

PS Pavithra Subramaniyam Syncfusion Team November 24, 2021 02:58 PM UTC

Hi linh, 

Thanks for contacting Syncfusion support.  

You can achieve your requirement by binding an internal event “batcheditform-rendered” which is triggered after the edit input element is rendered. Inside this event handler, you can select the text using the “select” method. Please refer to the below code example and sample link for more information. 

@Component({ 
  selector: 'app-root', 
  template: `<ejs-grid #grid id="Batchgrid" [dataSource]="data" allowPaging="true" [pageSettings]="pageSettings" 
  [editSettings]="editSettings" [toolbar]="toolbar" (created)="created($event)" (destroy)="destroy($event)"> 
  .   .   . 
</ejs-grid>`, 
  providers: [ToolbarServiceEditServicePageService], 
}) 
export class AppComponent { 
  
  public ngOnInit(): void { 
    .  .  . 
  created(args) { 
    // add the event while Grid created 
    this.grid.on('batcheditform-rendered'this.inputSelectText); 
  } 
  destroy(args) { 
   // remove the event while Grid destroyed 
    this.grid.off('batcheditform-rendered'this.inputSelectText); 
  } 
  inputSelectText(cellEditArgs: any) { 
    cellEditArgs.cell.querySelector('input').select(); 
  } 
} 



Please get back to us if you need further assistance on this. 

Regards, 
Pavithra S 



UN Unknown November 25, 2021 09:06 AM UTC

Hi Pavithra S ,

thanks for your quick response

Regards,

Linh



PS Pavithra Subramaniyam Syncfusion Team November 25, 2021 11:26 AM UTC

Hi linh,  

You are most Welcome! Please contact us if you have any other queries. As always, We are happy to assist you. 

Regards, 
Pavithra S 


Loader.
Up arrow icon