Reputation: 187
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
Reputation: 4269
If you do not want that particular column to sort, then disable it in your grid's configuration. API Reference.
Upvotes: 1
Reputation: 12855
Try adding return false;
, which works like e.preventDefault():
onclick='alert(1); return false;'
Upvotes: 0