Skip to content

How do I create the same menu for multiple items? #11

@rkostes

Description

@rkostes

I am trying to create the same menu for all objects with a given name. I am using the menu from the readme just to get it to work. When I right click on an object I get the following error:

Message: Object doesn't support property or method 'forEach'
Line: 46
Char: 5
Code: 0
URI: http://localhost:8080/SWNOrderProcessingWeb/common/jquery.contextmenu.js

The obects with name='3' are all unordered list items.

$("[name^='3']").contextPopup({
    title: 'My Popup Menu',
    items: [
      {label:'Some Item',     icon:'icons/shopping-basket.png', action:function() { alert('clicked 1') } },
      {label:'Another Thing', icon:'icons/receipt-text.png',    action:function() { alert('clicked 2') } },
      null, /* null can be used to add a separator to the menu items */
      {label:'Blah Blah',     icon:'icons/book-open-list.png',  action:function() { alert('clicked 3') } },
    ]});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions