Question

I am using the jQuery selectable on a table like this...

 var body=$("<tbody class='selectable'></tbody>")
 body.selectable({
     filter: 'td:not(:first-child)'
 });
 // this is the first column which is filteres out of the selectable
 $(".first-col").on('click',function(e){
      console.log("click for first column is here");
 });

I would like the first column to have a different callback function, but the click on the first column never gets called. Is it possible to do this? What am I doing wrong?

Thanks for any help V

Was it helpful?

Solution

This is actually a known "bug" with selectable. You can set the distance option to anything other than 0 (default) to fix this but the best way is just to change your click even to mousedown (will work).

Example...

 $(".first-col").on('mousedown',function(e){
      console.log("click for first column is here");
 });
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top