This is a migrated thread and some comments may be shown as answers.

open modal popup on grid header dblclick

1 Answer 184 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Saurabh
Top achievements
Rank 1
Saurabh asked on 28 Apr 2015, 07:23 AM

I want to open modal popup when kendo-grid header is double clicked.I tried the following

headerAttributes: { 'ondblclick':'openPopup(event)' }
 
function openPopup(ev){
ev.preventDefault();
return false;
}

This way, the popup opens correctly but it also sorts the grid (default grid functionality).

Please suggest how to prevent grid from sorting when header is double clicked.

1 Answer, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 30 Apr 2015, 06:48 AM

Hello Saurabh,

Such behavior could not be achieved due to sequence of firing the mouse single and double click. The single click will be fired always before the double click.

One possible solution for your case is placing a button in the headerTemplate and attach click handler with e.stopPropagation() in order to avoid sorting if the button is clicked. This way click on the button will open the popup, but not sort the column. 

Regards,
Boyan Dimitrov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Saurabh
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Share this question
or