DataTables with Context Menu

DataTables with Context Menu

touchmenottouchmenot Posts: 9Questions: 0Answers: 0
edited October 2011 in General
I have integrated a "context menu" to DataTables. All works fine on Safari, Firefox, Chrome and IE8+. But I just tested in IE6 and IE7, the context menu shows up only on the FIRST row of the table I load. One rest of the rows, nothing happens when i click on the cell where the event is tied to.

Here's the context menu I am using with in DataTables.

http://beckelman.net/demos/jQueryListViewWithContextMenu/Default.aspx

Any idea what could be the issue in IE6 or IE7? I am not an expert on javascript. So any advice / guidance is appreciated.

Here's how I have the script for datatables and the context menu.

[code]
$(document).ready(function() {

$("#myContext1Menu DIV").contextMenu({
menu: 'myContext1Menu', anyClick: true
},
function(action, el, pos) {
window.location=action + $(el).attr('id');
});

$("#myContext2Menu DIV").contextMenu({
menu: 'myContext2Menu', anyClick: true
},
function(action, el, pos) {
window.location=action + $(el).attr('id');
});

$('#myTable').dataTable({
"bPaginate": true,
"bLengthChange": true,
"bFilter": true,
"bSort": true,
"bInfo": true,
"bAutoWidth": true,
"sPaginationType": "full_numbers",
"bJQueryUI": true,
"aaSorting": [],
"aoColumnDefs": [
{"bSortable": true,"aTargets": [6] }
]
} );
});
[/code]

Replies

  • touchmenottouchmenot Posts: 9Questions: 0Answers: 0
    Just an update. I did some more troubleshooting and narrowed the issue to the Context Menu library setup i have. So after all I should not have posted the question here :). Sorry about that. I will update the post once I fix the issue if this may help someone to integrate a context menu with DataTables.
  • touchmenottouchmenot Posts: 9Questions: 0Answers: 0
    OK. Finally fixed the issue which was not related to DataTables and the context menu. The context menu did not work on any row except the first since my initialization script was using an ID on the html TABLE . I changed that to a "class" and all worked OK on IE 6. (Also changed the initialization script to .className instead of #id). I hope it will work on IE 7. I dont have one to test it out.

    So any one interested in adding a Context menu to dataTables, the script / link on the initial post should work with no issues.
This discussion has been closed.