Prevent row deselection
Prevent row deselection
ILyaCyclone
Posts: 9Questions: 2Answers: 0
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.