Okunma Sayısı : 65

Demo Download

HTML

<!-- Right Click Menu -->
<ul id="myMenu" class="contextMenu">
    <li class="insert"><a href="#insert">Add New</a></li>
    <li class="edit"><a href="#edit">Edit</a></li>
    <li class="delete"><a href="#delete">Delete</a></li>
</ul>

jQuery

$(document).ready(function() {
    //Tie a menu to the right click of each row of the table with a class of customerRow
    $(".customerRow").contextMenu({ menu: 'myMenu' },
        function(action, el, pos) { contextMenuWork(action, el, pos); });

    //Tie a menu the left click of each td with the class of openmenu !Important - requires modified
    //jquery.contextMenu.js that allows for leftButton: true
    $(".openmenu").contextMenu({ menu: 'myMenu', leftButton: true },
        function(action, el, pos) { contextMenuWork(action, el.parent("tr"), pos); });

    });

    function contextMenuWork(action, el, pos) {

        switch (action) {
            case "delete":
                {
                    //Popup Delete Confirmation - included in demo and in download
                    break;
                }
            case "insert":
                {
                    //Popup Insert Dialog- included in demo and in download
                    break;
                }

            case "edit":
                {
                    //Popup Edit Dialog
                    break;
                }
        }

   }
});

Kaynak(Source)