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

Prevent "rowchange" from kendo-menu inside column template

4 Answers 138 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bridge24
Top achievements
Rank 1
Iron
Iron
Bridge24 asked on 13 Oct 2015, 12:59 PM

Hi,

I configured a "action column" inside my kendo Grid, with a kendoMenu that allow me to do some tasks on my row item. 

I want to run an action directly without selecting the row (because when I select the row, I do some other actions that I do not want to do from the action menu)

My code: http://dojo.telerik.com/otEQI/16

I need to prevent "rowchange" event from a kendoMenu change event that I set inside a columnTemplate.

I tought I could do something inside the menuChange event (like e.preventDefault()), but it happen AFTER the rowchange event! 

How can I prevent the rowChange to raise when I click on my kendoMenu item?

Thank you.

4 Answers, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 14 Oct 2015, 02:50 PM
Hello Dani,

In order to prevent the selection when you click on the Menu (or in the Menu cell), you need to follow the approach from the following help article:
For your convenience, following is the modified dojo, which works as per your requirement:
Hope this helps.



Regards,
Konstantin Dikov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
 
0
Bridge24
Top achievements
Rank 1
Iron
Iron
answered on 14 Oct 2015, 04:45 PM

Hi, thank you for your reply. I tried your solution.  

The only think it does, is that it doesn't set the line "orange".  

But, I the rowChange of the grid is raised, the currently selected row is un-selected.

Example: Click on first row, second column.  The row is selected in orange.

After, if I select any item of first column of row 2, the first row is un-oranged, the row 2 is seleted (without being orange).

I want the row 1 to stay orange, even if I select an action on row 2.

Is it possible to keep the current selection, to "block" the rowchange event of happening?

http://dojo.telerik.com/aWIVi/4

0
Bridge24
Top achievements
Rank 1
Iron
Iron
answered on 15 Oct 2015, 06:43 PM

Finally, I got it!  You send me in the good direction with the "mouseup" event, but I set it in my column template kendoMenu instead of the grid td.  

It creates a better result, I can select the row by clicking on it beside the menu, but any click on the menu does not raise the "onchange" event.

p.s. your fix only prevent the "orange" paint of the row, but the "rowchange" was raised.

Solution: http://dojo.telerik.com/otEQI/29

 

0
Accepted
Konstantin Dikov
Telerik team
answered on 16 Oct 2015, 09:06 AM
Hi Dani,

I am really glad to see that you have found a solution for the issue that you have faced with my approach. Handling the onmouseup event of the element in your template is indeed the better approach and will allow you to stop the propagation of the event.


Best Regards,
Konstantin Dikov
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
Bridge24
Top achievements
Rank 1
Iron
Iron
Answers by
Konstantin Dikov
Telerik team
Bridge24
Top achievements
Rank 1
Iron
Iron
Share this question
or