SortableJS / jquery-sortablejs

A jQuery binding for SortableJS

Home Page:https://sortablejs.github.io/Sortable/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does it work with the MultiDrag plugin?

aurovrata opened this issue · comments

I am trying to use the multidrag utils methods select and deselect

These should work together without a problem. You'd still have to mount the plugin like normal

Sortable.mount(new MultiDrag());

and then you can pass the options in the jquery call like this

$('#my-list').sortable({
	// SortableJS options go here
	// See: (https://github.com/SortableJS/Sortable#options)
	handle: '.handle',

	multiDrag: true, // Enable the plugin
	selectedClass: "sortable-selected", // Class name for selected item
	multiDragKey: null, // Key that must be down for items to be selected

	// Called when an item is selected
	onSelect: function(/**Event*/evt) {
		evt.item // The selected item
	},

	// Called when an item is deselected
	onDeselect: function(/**Event*/evt) {
		evt.item // The deselected item
	}
});

Thanks! I got to work as per the instructions on the gituhub page, but I was actually wanting to know if instead of using
Sortable.utils.select(item)
to programmatically select an item in the multidrag sortable list, there was a jquery equivalent.

@aurovrata there isn't this functionality yet, but I or @depuits could add it if he wants

no issues, I am happy to switch back to js for this functionality to work... I was just asking in case it existed.