I have a primefaces p:treeTable, inside that I define a column includes 2 components: span tag and h:outputText tag. Currently, if I click on one of these elements, select event of table is triggered. But my purpose is that the select event will be fired only if I click of the text (and not for the span element). How can I do that?
You can prevent the event from bubbling up the DOM, by using JQuery's event.stopPropagation() function.
<span id="someId" onclick="if(event.stopPropagation) event.stopPropagation();">...</span>
JQuery API - event.stopPropagation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With