Jump to content

Enable/disable events?


LLLLLLL

Recommended Posts

I'm using http://api.jqueryui.com/sortable/ and I'd like my table to be unsortable by default, a user clicks something, and then it's sortable, then they click something else and it's not sortable.

 

I thought I could use these two functions:

function enable_sort() {
	$( ".btf_table tbody:first" ).sortable({
	    helper: fixHelperModified,
	    stop: updateIndex,
	    axis: "y"
	    //handle: '.handle'
	}).disableSelection();
}

function disable_sort() {
	$( ".btf_table tbody:first" ).off();
}

I can use them, but then I cannot use "enable_sort" again after "disable_sort" is called. I'm sure I'm mis-uisng the "off" function but I'm not sure what I'm supposed to be calling instead, or with which parameters.

Link to comment
https://forums.phpfreaks.com/topic/283701-enabledisable-events/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.