JavaScript Getting attributes of source element in JQuery UI Context Menu

I wanted to get the data-id attribute of the source element when the context menu is activated. How can i access the source element? Here is what Ive done so far:

 $(".action").contextmenu({
        menu: [
            {title: "View", cmd: "view", uiIcon:'ui-icon-zoomin' },
            {title: "Edit", cmd: "edit", uiIcon:'ui-icon-pencil'},
            {title: "Login History", cmd: "history", uiIcon:'ui-icon-clock'},
            {title: "----"},
            {title: "Deactivate", cmd: "deactivate", uiIcon:'ui-icon-closethick'},
            {title: "Switch", cmd: "switch", uiIcon:'ui-icon-newwin'},
        ],
        select: function(event, ui) {
            //get the 'data-id' attribute here.          
        }
    });

Thank you so much!

Answer:1

I'm trying to use setState in map function what I want to make when I hit click button that makes states changed I searched "In map function changed setState" in stackoverflow but It was hard to ...

I'm trying to use setState in map function what I want to make when I hit click button that makes states changed I searched "In map function changed setState" in stackoverflow but It was hard to ...

  1. setstate function react
  2. setstate functional component react
  3. setstate function component
  4. usestate functional update
  5. setstate function vs object
  6. setstate function in flutter
  7. setstate function instead of object
  8. setstate function syntax
  9. setstate function parameter
  10. setstate function form
  11. setstate function argument
  12. setstate function in react native

I run an e-commerce website and we have various third-party JavaScript that add click handlers to links and forms and then insert a delay to make sure the tracking goes through. The delay is inserted ...

I run an e-commerce website and we have various third-party JavaScript that add click handlers to links and forms and then insert a delay to make sure the tracking goes through. The delay is inserted ...

I'm trying to write a solution to a problem that requires three possible different return values depending on the result of two values. The possibilities are greater than, less than, or equal to. An ...

I'm trying to write a solution to a problem that requires three possible different return values depending on the result of two values. The possibilities are greater than, less than, or equal to. An ...

I want to build my website using Javascript for front end and PHP for backend. I want to know how can I keep header & footer same on all pages if I am using javascript for client side. I can do it ...

I want to build my website using Javascript for front end and PHP for backend. I want to know how can I keep header & footer same on all pages if I am using javascript for client side. I can do it ...

  1. freeze header footer
  2. keep header and footer on first page only
  3. keep header and footer on all pages in word
  4. keep header remove footer
  5. excel remove header keep footer
  6. word remove header keep footer