Opened 9 years ago

Closed 9 years ago

#7466 closed bug (notabug)

Dynamically removing selectees from selectable

Reported by: kblomqvist Owned by:
Priority: minor Milestone: 1.9.0
Component: ui.selectable Version: 1.8.13
Keywords: Cc:
Blocked by: Blocking:

Description

See comments below ...

$(".selectable").selectable({

    selected: function(event, ui) {
        
        // I would like to have the next selectee to be not selectable. Unfortunately
        // this is not working as expected. The next one is still selectable by the single click.
        // However drag selecting correctly recognizes that this selectee has been disabled.
        $(ui.selected).next("li").removeClass("ui-selectee");
    },

    stop: function() {

        // Recalculate the position and size of each selectee
        $(this).selectable('refresh');
    }
});

Change History (1)

comment:1 Changed 9 years ago by rdworth

Resolution: invalid
Status: newclosed

The ui-selectee class is not what makes an item selectable, it's a side-effect, for theming. What makes an element selectable is it matching the filter option. http://docs.jquery.com/UI/Selectable#option-filter . Until you've confirmed a bug exists, please discuss on the forum http://forum.jquery.com/using-jquery-ui and when you do so, please share a working minimal example using jsbin.com or jsfiddle.net

Note: See TracTickets for help on using tickets.