Adding context menu to datatable
Adding context menu to datatable
alekhine54
Posts: 2Questions: 0Answers: 0
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?
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?
This discussion has been closed.
Replies
Show a menu within a modal on right click event.
Honestly I haven't implemented it. But ...