recordDoubleClick on aggregates section

Dear Syncfusion Team,

I am creating a grid using the Syncfusion Grid Component. I am familiar with the recordDoubleClick event that can be triggered when double-clicking a cell in the grid. As far as I know this event is only binded to the grid and not to sections external to the grid. I would like to be able to trigger a function upon double-clicking a row in the aggregates section of the grid. Is this achievable?

Please find a working example of the grid in the following StackBlitz project :

Regards,
Remy

3 Replies 1 reply marked as answer

SM Shalini Maragathavel Syncfusion Team June 22, 2020 03:18 PM UTC

Hi Remy, 

Greetings from syncfusion support. 
 

By default recordDoubleClick event is triggered when we double click the Grid content rows only (it is not triggered the aggregate cell). So we have achieved your requirement by using the following way. 


We have bind the ‘dblclick’ event in the document.body through the Grid ‘created’ event. Please find the code example and sample for your reference. 
 

export class AppComponent { 
    public data: Object[]; 
    public pageOption: Object = {pageCount: 5}; 
    created(args){ 
      document.body.addEventListener('dblclick', dblClickFun.bind(this)) 
    } 

    public ngOnInit(): void { 
        this.data = orderData; 
    } 
function dblClickFun(e){ 
// check the target element as summarycell 
  if(e.target.classList.contains('e-summarycell')){ 
    // you can perform here 
    console.log('dbl event triggered') 
  } 
  else { 
    e.preventDefault()// prevent the event when the target is not summarycell 
 
  } 
} 
 




Regards, 
 
Shalini M 


Marked as answer

RE Remy June 26, 2020 06:06 AM UTC

Hello Shalini,

That worked great. Thank you for your support.

Regards,
Remy


BS Balaji Sekar Syncfusion Team June 29, 2020 08:07 AM UTC

Hi Remy, 
  
We glad that your issue has been fixed.  
  
Please get back to us if you require further other assistance from us. 
  
Regards, 
Balaji Sekar. 


Loader.
Up arrow icon