3

I am using the jQuery DataTables plugin: http://datatables.net/examples/basic_init/zero_configuration.html

By default users are able to select cells by holding the control key and clicking.

I would like to disable this functionality. There does not seem to be an option or api function for this.

Does anyone know how I can achieve this, preferably without modifying the original source?

Thanks!

davidkonrad
  • 83,997
  • 17
  • 205
  • 265
SaphuA
  • 3,092
  • 3
  • 39
  • 58
  • http://stackoverflow.com/a/5517930/1982680 check this if it can help you ! and please provide your code that you have done for dataTable – Dipali Vasani Nov 27 '14 at 12:35

1 Answers1

3

This is not a dataTables issue - it is a browser issue. There is nothing in jQuery dataTables that provides this "feature". And to be more clear : It is a FireFox specific feature that do not exists in Chrome or Opera (for example).

Try open a FireFox, go to this page and ctrlclick on your own question above. Yes - the exact same thing happens!

If you programmatically want to disable this feature, see https://support.mozilla.org/en-US/questions/763547.

Very simple, add -moz-user-select: none to elements you not want to be selected by ctrlclick in FireFox. Here is an example :

table.dataTable tbody th, table.dataTable tbody td {
    -moz-user-select: none;
}

demo -> http://jsfiddle.net/0o0h2ry7/

...disables the ctrlclick feature in FireFox for a dataTable (1.10.x)

davidkonrad
  • 83,997
  • 17
  • 205
  • 265