ContextMenu to sub_row_grid.

I try to attach a contexmenu to a grid generated by sub_row_grid this way:

master_grid.enableContextMenu(menu1); master_grid.attachEvent('onBeforeContextMenu',function(){ doFunction1(); }); master_grid.attachEvent('onSubGridCreated',function(slave_grid){ slave_grid.enableContextMenu(menu2); slave_grid.attachEvent('onBeforeContextMenu',function(){ doFunction2(); }) });

The problem is when i right-Click on slave_grid doFunction1() is call instead of doFunction2();

Is this a known issue or am i doing something rong ?