Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6596963
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:08:51+00:00 2026-05-25T18:08:51+00:00

I am working with jQuery’s sortable (jQuery ui) By default dropOnEmpty = true ,

  • 0

I am working with jQuery’s sortable (jQuery ui)

By default dropOnEmpty = true, and as a speedup I’m applying the connectwith after I apply .sortable() to my selectors as follows:

<script type="text/javascript">  
  $('#selector1').sortable({ 
    over: function(ev,ui){
      console.log('Dragging over: '+$j(ui.placeholder).parent().parent().parent().attr('id'));
    } 
  )};  
  $('#selector2').sortable({ 
    over: function(ev,ui){
      console.log('Dragging over: '+$j(ui.placeholder).parent().parent().parent().attr('id'));
    } 
  )};

  $('.ui-sortable').sortable('option', connectWith', '.ui-sortable');
</script>

I’ve demonstrated my logging to try to figure out what’s going on – Imagine I first drag from #selector1 to #selector2 (which is empty) – no logging appears, but than if I drag back into the source, I get the logging, and than when I drag back into the target column it works?

The empty selector even has ui-sortable class but it’s not connecting!

How should I make sure that even the empty lists while applying the connect-with after initializing the the connectWith separately?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T18:08:51+00:00Added an answer on May 25, 2026 at 6:08 pm

    http://jsfiddle.net/MMyP3/5/

    EDIT: Code as requested:

    HTML:

    <div id="container" style="display:inline">
    <div id="column1" class="column">
    
    <div class="element">Element 1</div>
    <div class="element">Element 4</div>
    
    </div>
    
    <div id="column2" class="column">
    
    <div class="element">Element 2</div>
    <div class="element">Element 3</div>
    
    </div>
    
    <div id="column3" class="column">
    
    </div>
    

    CSS:

    .column{
        border: 1px solid #E9EAEA;
        border-radius: 5px 5px 5px 5px;
        margin: 10px;
        min-width:100px;
        padding: 5px;  
        float:left;
        width:100px;
    }
    
    .element{
        border: 1px solid #E9EAEA;
        border-radius: 5px 5px 5px 5px; 
    }
    

    Javascript:

    $('.column').sortable({
        var $this = $(this);
        activate: function(en, ui) {
            $this.css('min-height', '100px');
            $this.css('background-color', '#666');
        },
        deactivate: function(en, ui) {
            $this.css('min-height', '0px');
            $this.css('background-color', '#FFF');
        },
        placeholder: 'ui-state-highlight'
    });
    
    $('.column').sortable('option', 'connectWith', '.column');​
    

    Edit: I updated my link, I think the main issue was your html structure which I adjusted, also make sure you are dragging the elements to the top of the empty divs. Just because you are changing the background color and min-height doesn’t mean the actual sortable’s height is changing. So it may look like you can place the items any where in the open area, in reality you actually can’t, unless you define heights for the sortables on the get go.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How have you guys handled working with jQuery includes <script type=text/javascript src=jquery.js></script> in Asp.Net
I have been working with jquery-ui's sortable demo for a while. On looking closely,
I have this script working with jquery and uploadify $('#uploader').uploadify({ 'uploader' : '/admin/includes/uploadify/uploadify.swf', 'script'
Still working through JQuery to get data and repopulate portions of a page. Right
I am working with jQuery Form and ASP.NET MVC. Preview 5 of ASP.NET MVC
I'm working with jQuery for the first time and need some help. I have
I'm working with jQuery UI's droppables and am wondering what the best way to
I've been working with jQuery and *.asmx web services lately, and I'm trying to
I'm working with jQuery and looking to see if there is an easy way
I've been working with jQuery for a pair of weeks and I've noticed it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.