Select style `os` and behaviour of checkbox
Select style `os` and behaviour of checkbox
Link to test case:
http://live.datatables.net/xixasusa/1/
Description of problem:
1. Select some rows, e.g. rows 1-4
2. Click on the checkbox of one of the selected rows, e.g. row 2
Current behaviour
Row 2 is selected
Expected behaviour:
Rows 1, 3, and 4 are selected
The behaviour of the checkbox is unexpected and feels unnatural. Windows Explorer behaves as expected.
Is it a technical limitation of the CSS pseudo element or could this be changed in future releases?
This question has an accepted answers - jump to answer
Answers
Try the
multi+shift
option ofselect.style
. Like this:http://live.datatables.net/xixasusa/2/edit
Does that behave the way you like?
Kevin
Indeed, I did not know about the
multi+shift
option. I suppose I never checked the detail page ofselect.style
you linked and but only the select page:I think this should be fixed
Well, not really.
multi+shift
is a nice alternative, but I thinkos
is the mode I would like to use.However, I think it conflicts with the behaviour users (at least me) expect when clicking on a checkbox. I would like to know your opinions about this aspect
IMO the
os
option behaves as I would expect and as you described:I don't use Windows but on the Mac the Explorer works as above :-) Also the docs for the
os
option describe this same behavior:What part of
multi+shift
does not behave as you like?Kevin
Yes, everything is correct in general, but I speak specifically about the checkbox. I have attached a video of my test case:
I think that Canceling a selection is not as easy as with os
Seems like the video is working as you suggested you want. You are selecting a range then clicking one row to unselect. Is that not what you want?
Sorry if I'm missing an obvious issue.
Kevin
Are you referring to the checkbox not being visible unless checked? That is not expected when using Datatables select checkboxes. If that is the problem you are trying to solve then its a styling issue. Please post a link to your page or a test case replicating the issue so we can help debug.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
Yes, this is what I want, but unfortunately the video shows only Windows Explorer, not DataTables Sorry I did not make this clear
No, I just refer to functionality, not to styling.
Test case is linked in the first post.
Although I think it is described quite clear in Expected Result and Current Result, I will try to rephrase the problem:
When clicking on a checkbox, it is not expected that other checkboxes are getting deselected.
So, the example I posted with
multi+shift
does not work for you? When I select multiple then just click one row that row becomes unselected with the others remaining selected.Kevin
It works (because in this mode a click by default adds/removes one row) and it is an alternative. But as I said, deselection does not work the same, for example. I would prefer to use
os
with this problem being fixed.The root problem with
os
is the following:I wonder what @allan thinks about it. Also I wanted to point him to my previous post where I described the outdated documentation before it gets lost.
Ctrl-click to deselect a single item without effecting others. This is how Finder in macOS and Explorer in Windows works as well. We've tried to model the
os
selection style of them.Allan
Thanks for the pointer about the list of selection types on the Select landing page. I've updated it in our repo and will deploy the fix soon.
Allan
Yes and no. You are right about the row (or in general, the selector) but you are wrong about the checkbox.
Please note that I talk about the checkbox. See my example about Windows Explorer in this post. In this example, file2.txt is deselected with a click without Ctrl or other modifying keys. I could not manage to find out how to enable checkboxes in Finder, so not sure about macOS
I see what you mean - yes. Thanks for the clarification - you are absolutely correct, we don't have a difference between the "checkbox" and full row selection like windows does (I'm quite certain that macOS doesn't have that ability).
We treat the checkbox as just the same as the full row selection.
I see the issue and agree there is a difference here due to how Windows is handling the checkbox. It isn't a behaviour we are going to change to match immediately, but I will review this and ask anyone else reading this and interested in this change to let us know.
Thanks,
Allan
Thanks Allan. I agree this is a bit of an edge case, but it would be nice to have it fixed someday. Normal users just expect that checkboxes work the same in every application.
For reference, the corresponding feature request for the checkboxes extension can be found here: https://github.com/gyrocode/jquery-datatables-checkboxes/issues/128