1

I'm having a big problem trying to get my head round how the selectable() and draggable() components of jqueryUI can work together.

They work fine on their own. I am trying to create a file browser type interface that users can select multiple files or drag INDIVIDUAL files to other droppable places in the app. I know a lot of people have been looking at ways to drag multiple files but this is not a requirement for me at the moment.

In the example provided selectable works if using the mouse drag marquee box but no longer works for simple mouse clicks or crl click to select multiple (when draggable is enabled).

EXAMPLE HERE: http://jsbin.com/aguju4/3/edit

2
  • This may be of some help, but it doesn't seem to be working in Chrome: nicolas.rudas.info/jquery/selectables_sortables Commented Mar 25, 2011 at 13:02
  • Decided to scrap the selectable plugin and build a basic version myself. The two don't seem to get on very well. I have based my own selectable solution on live() clicks so that it doesn't conflict with the draggable click events. Commented Mar 26, 2011 at 9:55

2 Answers 2

4

Decided to scrap the selectable plugin and build a basic version myself. The two don't seem to get on very well. I have based my own selectable solution on live() clicks so that it doesn't conflict with the draggable click events.

Sign up to request clarification or add additional context in comments.

3 Comments

Do you mind spreading your solution? I'm having the same problem. Thanks!
Same issue, bummed to see they don't play well.
1

You could have just use mousedown event to manually make the items selected.

var mouseDownCallback = function(e) {

    if (e.ctrlKey==0) $('#your-container').children().removeClass('ui-selected');

    $(this).addClass('ui-selected');

}
$('#your-container').on('mousedown','.item', mouseDownCallback);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.