Using value from column for right clickable menu in table

1 day ago 1
ARTICLE AD BOX

I hope someone can help. I have a 13 column table of members details, using javascript I have a right clickable menu displayable on each row.
In one column one, which is hidden, is the record ID number of each member. Is it possible to get the value from this column and use it to show the member details. Ie if the id is 12345 then store it in variable called id-column-one. I have included my code below.

Thanks Rob

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.js"></script> <ul class='custom-menu'> <li data-action="View">View</li> <li data-action="Renew">Renew</li> <li data-action="Amend">Amend</li> </ul> </body> </html> <script> // Trigger action when the contexmenu is about to be shown $(document).bind("contextmenu", function (event) { // Avoid the real one event.preventDefault(); // Show contextmenu $(".custom-menu").finish().toggle(100). // In the right position (the mouse) css({ top: event.pageY + "px", left: event.pageX + "px" }); }); // If the document is clicked somewhere $(document).bind("mousedown", function (e) { // If the clicked element is not the menu if (!$(e.target).parents(".custom-menu").length > 0) { // Hide it $(".custom-menu").hide(100); } }); // If the menu element is clicked $(".custom-menu li").click(function(){ // This is the triggered action name switch($(this).attr("data-action")) { // A case for each action. Your actions here case "View": window.open("https://url/memb-details-all/"id-column-one); break; case "Renew": alert("Renew"); break; case "Amend": alert("Amend"); break; } // Hide it AFTER the action was triggered $(".custom-menu").hide(100); }); </script>
Read Entire Article