Event bubbling issue

I’d like to attach an event to a link (or more links) inside TreeGrid:

$(document).on('click', '.mylink1', function(){
  // custom code
});
$(document).on('click', '.mylink2', function(){
  // custom code
});

However, it seems like ‘row clicks’ prevent the event to bubble, custom code never gets executed. Is this correct? How can I overcome this problem?

Is it possible to detach row click event?

Please, try to use the cancelBubble event for your link.

Is it possible to detach row click event?
Also you may block the row select from the onBeforeSelect event:
docs.dhtmlx.com/api__dhtmlxgrid_ … event.html
for example:
grid.attachEvent(“onBeforeSelect”, function(new_row,old_row,new_col_index){
return false;
});

Still no luck :frowning:
The only way that I’ve found is to reset onclick events:

$('.objbox').each(function() { this.onclick=function(){}; }); $('.objbox .obj').each(function() { this.onclick=function(){}; });
Is there a less obtrusive (conventional) way ?

cancelBubble should work well for your link.
Could you please, provide with the snippet of your code adding the link to a cell

Sure. Here’s a minimal code to reproduce the problem:

[code]

Dynamic loading (using PHP)
<link rel="STYLESHEET" type="text/css" href="../../../dhtmlxGrid/codebase/dhtmlxgrid.css">
<link rel="stylesheet" type="text/css" href="../../../dhtmlxGrid/codebase/skins/dhtmlxgrid_dhx_skyblue.css">

<script  src="https://code.jquery.com/jquery-1.11.3.js"></script>
<script  src="../../../dhtmlxGrid/codebase/dhtmlxcommon.js"></script>
<script  src="../../../dhtmlxGrid/codebase/dhtmlxgrid.js"></script>
<script  src="../../../dhtmlxGrid/codebase/dhtmlxgridcell.js"></script>
<script  src="../../codebase/dhtmlxtreegrid.js"></script>

Working …

</body>
[/code]

Did you manage to look at the example that I posted? Is there a standard solution for my problem?