Search code examples
jqueryjquery-ui-contextmenu

Reinitialize or check to see if menu is initialized


I am having an issue where I initialize the context menu on a grid, and it works but I have another function on the page that when clicked hides the grid, when I bring the grid back the menu no longer works, I am thinking that maybe re-initializing it will fix my problem.

How would I reinitialize the menu? If there is no "reinitialize" function than how can I check to see if the menu has been made before I destroy it and make another?

I know I can destroy it but I cant figure out how to tell if it is initialized first?

JS:

if(order.contextmenu("initialized"))
    order.contextmenu("destroy");

Solution

  • I was not able to fix this or figure it out, so I removed the context menu plugin and went with another plugin author who had good documentation (link below):

    http://swisnl.github.io/jQuery-contextMenu/