calumbrodie
calumbrodie

Reputation: 4792

Refresh method for removing jQuery UI Sortable element not working as expected

I'm trying to find a way to use the refresh method of jQuery ui sortable to remove an element from my sortable set.

The only way I've found to do this is to destroy the sortable and then recreate it, but I'm surprised that there is no method that does this (the refresh method seems to suggest that could be used for this purpose but I've had no luck)

Example is here

http://jsfiddle.net/5gN3X/1/

Upvotes: 0

Views: 1543

Answers (1)

Hussein
Hussein

Reputation: 42818

use cancel to disallow sortable on items with class .disabled

$('ul').sortable({cancel: '.disabled'});

Check working example at http://jsfiddle.net/5gN3X/3/

Upvotes: 1

Related Questions