I am trying to use datatable in conjunction with the context menu from:
http://www.javascripttoolbox.com/libsource.php/contextmenu/source/jquery.contextmenu.js
So far it "works" , but there is a small snag:
The context menu only shows for the rows that are displayed when the datatable is initialized(the first 10), but not for the others (ie on the nextpage)
here is the code:
oResultsTable = $('#tblresults').dataTable({"bSort": false,'sPaginationType': 'full_numbers'});
var menu1 = [ {'View Chart':function(menuItem,menu) { addChart(this); } }, $.contextMenu.separator, {'Add to Chart':function(menuItem,menu) { alert("You clicked Option 2!"); } } ]; $(function() { $('.resultname').contextMenu(menu1,{theme:'vista'}); });
any ideas on how to give all the rows the context menu?
I know i need to change this part { $('.resultname').contextMenu(menu1,{theme:'vista'}); })
and use the fnGetNodes somehow but all my experiments so far have failed.
each row has a classname=resultname
Thanks
Rich
http://www.javascripttoolbox.com/libsource.php/contextmenu/source/jquery.contextmenu.js
So far it "works" , but there is a small snag:
The context menu only shows for the rows that are displayed when the datatable is initialized(the first 10), but not for the others (ie on the nextpage)
here is the code:
oResultsTable = $('#tblresults').dataTable({"bSort": false,'sPaginationType': 'full_numbers'});
var menu1 = [ {'View Chart':function(menuItem,menu) { addChart(this); } }, $.contextMenu.separator, {'Add to Chart':function(menuItem,menu) { alert("You clicked Option 2!"); } } ]; $(function() { $('.resultname').contextMenu(menu1,{theme:'vista'}); });
any ideas on how to give all the rows the context menu?
I know i need to change this part { $('.resultname').contextMenu(menu1,{theme:'vista'}); })
and use the fnGetNodes somehow but all my experiments so far have failed.
each row has a classname=resultname
Thanks
Rich