cmonti
cmonti

Reputation: 187

How to prevent Kendo Grid click propagation

I need to add an image to one specific column, so I have something like that, This is good, I see the image, I just added am alert to see how is working. My problem is that after showing the alert, is executing the sorting. Is there a way to avoid the sorting when I just click on my image?

{
    field: "ShipName", headerTemplate: "<a class='k-link pull-left' href='#'>Charge</a><img onclick='alert(1)' src='http://localhost/MyApp/images/Reports/filterApplied.png' title='this is a filter'/>",
    title: "Ship Name"
}

Upvotes: 0

Views: 287

Answers (2)

Brett
Brett

Reputation: 4269

If you do not want that particular column to sort, then disable it in your grid's configuration. API Reference.

Upvotes: 1

Nic
Nic

Reputation: 12855

Try adding return false;, which works like e.preventDefault():

onclick='alert(1); return false;'

Upvotes: 0

Related Questions