Adding context menu to datatable

Adding context menu to datatable

alekhine54alekhine54 Posts: 2Questions: 0Answers: 0
edited September 2012 in General
I need to add this context menu to a column each row.

http://labs.abeautifulsite.net/archived/jquery-contextMenu/demo/

I tried this way:

[code]

$(document).ready(function () {
$(".mytable").dataTable();
$(".mytable-fn").dataTable({ sPaginationType: "full_numbers" });

$('.mytable-fn').dataTable({
"fnInitComplete": function () {
$(".mytable-fn TR").contextMenu({
menu: 'myMenu'
}, function(action, el, pos) {
alert(
'Action: ' + action + '\n\n' +
'Element text: ' + $(el).attr('id') + '\n\n' +
'X: ' + pos.x + ' Y: ' + pos.y + ' (relative to element)\n\n' +
'X: ' + pos.docX + ' Y: ' + pos.docY+ ' (relative to document)'
);
});
}

});
});
[/code]

Any suggestions?

Replies

  • girishmrgirishmr Posts: 137Questions: 0Answers: 0
    Just a thought though.
    Show a menu within a modal on right click event.
    Honestly I haven't implemented it. But ...
This discussion has been closed.