swisnl / jQuery-contextMenu

jQuery contextMenu plugin & polyfill
https://swisnl.github.io/jQuery-contextMenu/
MIT License
2.25k stars 746 forks source link

determinePosition not working #81

Closed dantsp closed 12 years ago

dantsp commented 12 years ago

First of all thanks for this great plug-in !!! I'm using this contextMenu on a gridview that is inside a panel and is visible upon click of a button. I'm aware that .position from jQuery doesnt work with hidden objects. However I found a hiddenPosition plugin that does the job very well. But when I change .position for hiddenPosition [http://www.garralab.com/hiddenposition.php] on jquery.contextMenu.js nothing happens and the context menu keeps showing on a strange position. I think that any customization I made is not being applied to the context. It's kind weird. There' s no hover effect when the mouse is over an item, contextmenu is never closing, even defining autoHide to true. There's something I'm missing or doing wrong ?

$.contextMenu({ selector: '.mnuContexto', autoHide: true, determinePosition: function($menu) { $menu.css('display', 'block').hiddenPosition({ my: "right top", at: "left bottom", of: this, offset: "0 5", collision: "fit" }).css('display','none'); }, items: { hrsignoff: { name: "Hora Signoff Dia", callback: function() { fnSignOffDia() } }, separador: "---------", signoff10m: { name: "Signoff 10 Minutos", callback: function() { fnSignOff10M() } } } });

Thanks!

rodneyrehm commented 12 years ago

can you provide a jsfiddle so I can see what's going on? I can't reproduce your problem…

dantsp commented 12 years ago

Thanks for fast reply !! Here is http://jsfiddle.net/MCZn6/. For my surprise everything works fine on jsfiddle, but when I'm running the app the problem happens. The contextMenu is on column "Boleta" (1260179 and 30087). When the page loads the panel (id="pnlResultado") is hidden and when the button "Consultar" is clicked it become visible and the gridview (id="gvResultado") where the context menu is being attached is loaded.

rodneyrehm commented 12 years ago

Ok, doesn't seem to be a problem of contextMenu then, does it?

dantsp commented 12 years ago

No, the problem doesn't seem to be of context Menu, as the deadline for this project is very close I'm afraid that I'll have to cut it off, and think of some other solution. That's too bad cause this plug-in is really great. Anyway, thanks for your support !!!