How to stop Ajax.ActionLink inside jQuery tree element from propagating click to tree element

Usually, as I understand it, you return false from the jQuery click handler and that stops the click for further progress. How could I achieve the same behavior with Ajax.ActionLink? Tree items use a click to expand and collapse, and clicking on the Ajax.ActionLink causes both the action link and the collapse / expand tree structure to execute.

+2


source to share


1 answer


Try using event.preventDefault (); and event.stopPropagation ();



$('#yourdiv a.collapse').live('click',function(event){
    event.stopPropagation();
    event.preventDefault();
});

      

+1


source







All Articles