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

  • Home
  • SEARCH
  • 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 3319660
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:51:03+00:00 2026-05-17T22:51:03+00:00

Clarification: I am trying to make the portlets sortable, but trying to connect them

  • 0

Clarification:

I am trying to make the portlets sortable, but trying to connect them with any columns that are siblings


I would like my web-application to automatically apply the jquery ui sortable interaction to all divs with the class .column.

There are two little tricks that I need in this solution, no its not as simple as $(".column").sortable()…

  1. I need the columns to connectWith any other columns that are siblings
  2. I would like the solution to apply to any .column elements that are dynamically generated, i’ve been looking for something similar to my new favorite toy, .live(), to no avail… although a custom event to detect a .column element creation might work, not sure how to do that though.

EX:

markup

<div id="container1" class="column-container">
  <div class="column">
    <div class="portlet"></div>
    <div class="portlet"></div>
    <div class="portlet"></div>
  </div>
  <div class="column">
    <div class="portlet"></div>
    <div class="portlet"></div>
    <div class="portlet"></div>
  </div>
  <div class="column">
    <div class="portlet"></div>
    <div class="portlet"></div>
    <div class="portlet"></div>
  </div>
</div>

javascript

$(document).ready(function(){
  $columns = $(".column");
  $columns.sortable({
    connectWith: $columns.parent().find('.column')  //this untested, but you get the idea... i'll write back with the results of this, might be some good direction
  });
});

I would like the columns in container1 to be sortable with other columns in container1, but not container2. Also those in container2 w/ container2 but not container1.

  • 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-17T22:51:04+00:00Added an answer on May 17, 2026 at 10:51 pm

    From what I understand this is easier than you are making it.

    For the sortable columns within a container, from your markup, the jquery activation would be:

    $('.column-container').sortable();
    

    The selector you currently have on your sortable would actually make the portlets sortable.

    As for the live events, refer to this earlier question:
    live drag and drop

    EDIT:

    After your comment, the selector would be:

    $('.column-container').sortable({items: '.portlet'});
    

    EDIT 2:
    Since it is still not working here is the full example:

        <style type="text/css">
            .column-container { width: 100%; }
            .column-container .column { float: left; width: 100px; background: #ccc; margin-left: 10px; }
            .column-container .column .portlet { border: 1px solid black; padding: 2px; margin: 2px; }
        </style>
        <script type="text/javascript">
            $(function () {
                $('.column-container').sortable({items: '.portlet'});
            });
        </script>
        <div id="container1" class="column-container">
            <div class="column">
                <div class="portlet">#container1 .column[0] .portlet[0]</div>
                <div class="portlet">#container1 .column[0] .portlet[1]</div>
                <div class="portlet">#container1 .column[0] .portlet[2]</div>
            </div>
            <div class="column">
                <div class="portlet">#container1 .column[1] .portlet[0]</div>
                <div class="portlet">#container1 .column[1] .portlet[1]</div>
                <div class="portlet">#container1 .column[1] .portlet[2]</div>
            </div>
            <div class="column">
                <div class="portlet">#container1 .column[2] .portlet[0]</div>
                <div class="portlet">#container1 .column[2] .portlet[1]</div>
                <div class="portlet">#container1 .column[2] .portlet[2]</div>
            </div>
        </div>
        <div style="clear:both"></div><br />
        <div id="container2" class="column-container">
            <div class="column">
                <div class="portlet">#container2 .column[0] .portlet[0]</div>
                <div class="portlet">#container2 .column[0] .portlet[1]</div>
                <div class="portlet">#container2 .column[0] .portlet[2]</div>
            </div>
            <div class="column">
                <div class="portlet">#container2 .column[1] .portlet[0]</div>
                <div class="portlet">#container2 .column[1] .portlet[1]</div>
                <div class="portlet">#container2 .column[1] .portlet[2]</div>
            </div>
            <div class="column">
                <div class="portlet">#container2 .column[2] .portlet[0]</div>
                <div class="portlet">#container2 .column[2] .portlet[1]</div>
                <div class="portlet">#container2 .column[2] .portlet[2]</div>
            </div>
        </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Clarification: this is not about user agent calls to pages, but Classic ASP calling
I have a byte array that represents a complete TCP/IP packet. For clarification, the
I am trying to compile my project in Xcode. But i am getting the
For clarification, here's the exact question in the about_regular_expressions.rb file that I'm having trouble
Clarification : Thanks for the suggestions of tools for validating XHTML. I'm primarily looking
(If anything here needs clarification/ more detail please let me know.) I have an
Is global memory initialized in C++? And if so, how? (Second) clarification: When a
I've got a classification problem in my hand, which I'd like to address with
I'm pretty strong with SQL, but I can't think of good solution to this
I am trying to find the solution for median of 5 sorted arrays. This

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.