Enable/disable

Apr 6, 2011 at 9:52 AM

Hi all,

is it possible to enable and disable DragSort when the page is already loaded ? Or attach/detach it from its DOM selector when needed ?

Coordinator
Apr 26, 2011 at 4:49 AM

I haven't got anything built in but to detach you can do this:

$("ul").unbind("mousedown").find("li").css("cursor", "default");

Where UL is the container selecter and LI is the drag selector, and to reattach you can just call the dragsort method again.

Note this will unbind all mousedown event handlers defined for the UL container, so if you do have others defined and want to keep them I can provide changes to the dragsort code that will allow you to only unbind dragsort and no other mousedown handlers.

Oct 11, 2011 at 10:42 PM

@mcm_ham:
This is important feature, please add it to API.
For example sortable to disable has this call:
$("#sortable").sortable('destroy'); 

Coordinator
Jan 14, 2012 at 1:00 AM
Edited Jan 18, 2012 at 11:50 AM

Done.
http://dragsort.codeplex.com/releases/view/80735

As suggested to invoke you call:

$("ul").dragsort("destroy");