Skip to content Skip to sidebar Skip to footer

Stop Table Row Toggle Upon Clicking Link

What I am trying to do is to stop the toggling when someone clicks on a url link in the table row. $(document).ready(function () { $('#report tr:odd').addClass('odd'); $('#

Solution 1:

I think below might work for you. Not tested though.

add a Javascript function call in your link

$("#ANCHIOR_ID").click(function(event){
    event.stopPropagation();
    // then do your job there that you want to do in on click
  });

Solution 2:

As the anchor is in tr element,whenever click on anchor is called ,the event will be propagated to the parent tr and its click function is also executed.

$('a').click(function(e){
    e.stopPropagation();
});

this stops the event of anchor click to bubble up to the parent


Post a Comment for "Stop Table Row Toggle Upon Clicking Link"