Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jquery ui sortable('refresh') not working!

I have a sortable list I'm working with that can have elements added and removed by another script through jquery and am having an odd problem. These newly generated items appear to be draggable, but they don't actually sort unless I have them already there at page load. I've tried using sortable('refresh'), but it seems to have no effect.

like image 477
Stephen Belanger Avatar asked Mar 09 '10 00:03

Stephen Belanger


2 Answers

To give you the opportunity to close this question, and just for reference sake in case anyone else stumbles across this, this seems to work fine in the latest jquery-ui. Here is a jsfiddle: http://jsfiddle.net/fordlover49/mVrGA/

like image 63
PriorityMark Avatar answered Sep 20 '22 05:09

PriorityMark


I had a similar problem. Once I added a new element to the sortable list nothing was draggable anymore. My solution was to call the destroy method:

$( ".selector" ).sortable( "destroy" ); 

first and then make it sortable again.

like image 36
bounty Avatar answered Sep 18 '22 05:09

bounty