jQuery-contextMenu icon indicating copy to clipboard operation
jQuery-contextMenu copied to clipboard

context menu selector on element

Open souparno opened this issue 8 years ago • 6 comments

presently the selector only accepts a sting, is there a way to bind the context menu to an element? ex: selector: $(elm)

souparno avatar Jan 02 '17 12:01 souparno

I believe it's a duplicate of https://github.com/swisnl/jQuery-contextMenu/issues/136 Looking forward to this feature for a few months yet.

psolom avatar Jan 21 '17 15:01 psolom

Yeah I've started on that feature a few times, but it seems to requires a lot of refactoring. Haven't had a big enough block of time to really dive into it.

Think you asked for selectors which mean sets, this seems more about a single element. Which is actually different.

bbrala avatar Jan 21 '17 15:01 bbrala

Actually it would be great if the "selector" accepts the following:

  1. selector string (as it works now)
  2. single jQuery element
  3. a set of jQuery elements
  4. self element. Means element to which the plugin has been applied (by default in case "selector" option isn't set / undefined / null)

Implementation of this list will provide a great flexibility.

psolom avatar Jan 21 '17 15:01 psolom

callback: function(key, options) {
if(key == 'delete') {
                        if (confirm('Are you sure?')) {
                            options.$trigger.remove();
                        }
                    }
                }

It works with me 💃

quangduy90 avatar Mar 28 '18 15:03 quangduy90

I need this feature as well

ndvbd avatar May 05 '18 19:05 ndvbd

I need this too. In my case it would be usefull to pass a selector like $("table tbody tr", some_var_as_context)

mcanepa avatar Apr 18 '19 19:04 mcanepa