I want to enable multiselect capabilities in a jQuery UI Selectable table by holding shift.
I probably should do something like this if shift i
After looking around I was unable to find a solution to this problem while still using jQuery UI's Selectable function, so I wrote one up. Essentially it taps into the selected / unselected callbacks of Selectable to manage DOM state while still honoring the callbacks as per the standard Selectable API. It supports the following use case:
Usage for a table:
$('table').shiftSelectable({filter: 'tr'});
A few notes. (1) It currently only supports sibling elements. (2) It will pass through configuration options as you will see in the table example as well as the Selectable methods. (3) I heart underscore.js so it is used even though for this it is not essential. Feel free to swap out its simple checks and extends if you don't want to use this awesome library. And no, I have no affiliation with underscore.js. :)
table fiddle example
list fiddle example
Hope this helps someone else! Cheers.