Multiple row selection but with click handler restricted to a single column
Multiple row selection but with click handler restricted to a single column
rgvcorley
Posts: 29Questions: 0Answers: 0
I have an editable table and I would like to use the "sRowSelect" : "multi" option, however because the cells are editable I would like to restrict the click handler for selecting a row to a single column (which I can have a checkbox in or something).
TableTools adds the click handler using jquery's live(), so I am try to remove this handler with the following:-
[code]$('tr').die('click');[/code]
But it's not having any effect. I've tried the other similar function [unbind() and the jq 1.7 recommended off()] but these don't work either. Also tried doing it with a timeout in case it was adding the handler before I was removing it, but still no joy.
Thanks in advance for any guidance/hints!
TableTools adds the click handler using jquery's live(), so I am try to remove this handler with the following:-
[code]$('tr').die('click');[/code]
But it's not having any effect. I've tried the other similar function [unbind() and the jq 1.7 recommended off()] but these don't work either. Also tried doing it with a timeout in case it was adding the handler before I was removing it, but still no joy.
Thanks in advance for any guidance/hints!
This discussion has been closed.
Replies
However, here is a method of achieving what you want with fnPreRowSelect: http://live.datatables.net/ataqon/edit .
Hmmm - it is very odd about the die not working... I'll look into that a bit more.
Allan
I should have spotted the preRowSelect to be honest because I was looking at that method to see how the handler was attached!
Thank you very much!