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!

1

1 Answer 1

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)

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks! I will test this out tomorrow! I feel like a moron if this is true :D

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.