Context menu and tabs

I have several grids in tabbar (one per tab). And I have context menu attached to a grid in one tab. If I open that menu and then click anywhere in the same grid, it closes, which is what I would expect. But if I go to another tab and click grid there, I still have the menu from the previous grid! How can I close context window when user clicks on another tab? Thanks!!

You can add the next code

tabbar.attachEvent(“onSelect”,function(){
context_menuN.hideContextMenu();
return true;
});

with it, each time, when active tab will be changed in tabbar - context menu will be closed.



Thank you, worked like a charm! Could you also tell me how can I block the browser default context menu from popping up? Sometime, if I multiclick, I get both grid’s context menu and browser context menu (FF and IE)

You can try to use

dhtmlxEvent(tabbar.entBox,“contextmenu”,function(e){
(e||event).cancelBubble = true;
return false;
})

It will block native content menu for all tabbar’s zone.
If necessary , a separate patch for the grid can be provided which fully block native context menu for any grid, if custom context menu was attached ( this fix will be included in next version of dhtmlxgrid )

Thank you, it worked. Maybe you could help with 2 more questions -

1) looks like if I drag row to below last row in the grid, it doesn’t drop as new last, but rather get’s “stuck” to cursor and if I keep clicking, eventually breaks with error in dhtmlxcommon. Is there a way to fix that?

2) also looks like the legend for the row that’s being dragged is behind the grid and tabbar. I can only see it when moving cursor outside. Is there a fix for that?


Hello,


could you please provide the code that demonstrates how tabbar and grid are initialized.

Below is one of my test samples. I played with initializing grid first, tabbar first, but it still has these issues. To test: 1. try dragging row, observe that legend is behind the tabbar. 2. Start dragging a row and release button below the grid. Move mouse back over the grid - observe the row is still dragging with the mouse. Try dropping it on any row - observe it doesn’t drop. Try dropping it to the side of the grid (outside grid rectangle) - breaks with error in common.

Please, let me know if there are any fixex / workarounds available.

Tester

 
 

 

 
 
 

 
 

 
 

 

 
  


  

 


Hello,


the issue wasn’t reproduced locally. The sample is attached


1246367224.zip (97.6 KB)

Try this with Fire Fox, please. IE seems to be working. I tested with FF 3.0.11 and it doesn’t work

please, try to use attached dhtmlxgrid.css. It has solved the issue in FF
dhtmlxgrid.zip (2.58 KB)

Thank you, it fixed the legend, which is nice. But what’s worse for me is that the drag still has problem. Try testing it on my sample, please. Maybe having scroll bar is an issue?


>> Try testing it on my sample, please. Maybe having scroll bar is an issue?


The sample isn’t attached …What sample do you mean ?

I’m attaching both HTML and XML that I used. The description of issue again is: - if you start dragging row and drag mouse BELOW the grid, after you return mouse to grid the row is still glued to cursor and you can not drop it anymore. The only way to un-glue that row is now click TO THE RIGHT of the grid, and this breaks with exception in dhtmlxcommon.

Please, let me know if you can replicate, and what the fix is

pbconfigfeeder.xml.zip (659 Bytes)
tester.html.zip (664 Bytes)


Try to add following style to avoid this issue:



html , body {
height:100%;
}




THANK YOU!! Worked like a charm!!! :slight_smile: