Prevent row deselection
Prevent row deselection
![ILyaCyclone](https://secure.gravatar.com/avatar/a4ae113cedee9ecc4485cb0291abc4c6/?default=https%3A%2F%2Fvanillicon.com%2Fa4ae113cedee9ecc4485cb0291abc4c6_200.png&rating=g&size=120)
Hello.
I'm using DataTables with Select extension.
select: {style: "single"}
So user selects a row by clicking on it.
I don't want the row to be deselected when user clicks on it again. Just do nothing.
Any informaton on how to stop deselect event?
"datatables.net": "^1.10.16",
"datatables.net-bs": "^2.1.1",
"datatables.net-select-bs": "^1.2.3",
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Looks like this is a duplicate.
Use the
user-select
event to prevent Select taking actions. Currently there isn't a built in mode in Select that will force there always to be a row selected.Allan
What would be the proper way to tell "deselect" event from "select" in "user-select" handler?
Select itself hasn't run its logic to determine if it should select or deselect at the point the
user-select
event runs. What you would need to do is check to see if the row(s) clicked on are selected or not - e.g.:Allan
Perfect. Works fine, thank you very much.