views:

12

answers:

1

Hello,

the cancel option on selectable does the following:

Prevents selecting if you start on elements matching the selector.

Is there a build-in way to make it ignore elements even if you drag over them? Cause with cancel it only works if you start from the element but if you start from a selectable element and drag the lasso over one of the canceled elements it will still select them.

If there isn't a build-in way I guess I have to add it myself with the selecting event.

+1  A: 

You can use the filter option with a :not() selector for this, for example:

$(".selector").selectable({ 
  cancel: 'li.cancelClass', 
  filter: 'li:not(.cancelClass)' 
});

This prevents those same cancel elements from being selected in the lasso either...they normally do get selected because the default filter is *.

Nick Craver
Thanks again Nick. Strange that sortable uses items and selectable uses filter.
Pickels