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 8551175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:08:15+00:00 2026-06-11T14:08:15+00:00

I use knockout-sortable.js to let the user drag and drop items to give them

  • 0

I use knockout-sortable.js to let the user drag and drop items to give them a different order, but I’m experiencing problems when I have multiple ‘drop zones’ on my page. I have nested sets, all of which are sortable, but not interchangeable.

My code:

    <div class="sortable" data-bind="sortable: blueprint.pages">
          <tr><td>Blabla</td></tr>
    </div>

And at some other point:

    <div class="sortable" data-bind="sortable: selectedPage().page_sections">
          <tr><td>Another blabla</td></tr>
    </div>

I can now just drag and drop ‘Another blabla’ into ‘Blabla’, causing errors. How can I prevent this from happening?

  • 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-06-11T14:08:17+00:00Added an answer on June 11, 2026 at 2:08 pm

    There are a couple ways to go about this. The first is to pass in to knockout-sortable the connectClass as false or null (or anything that is equal to false when expressed as a boolean):

    <div class="sortable" data-bind="sortable: { data: blueprint.pages, connectClass: false }">
        <tr><td>Blabla</td></tr>
    </div>
    
    <div class="sortable" data-bind="sortable: { data: selectedPage().page_sections, connectClass: false }">
          <tr><td>Another blabla</td></tr>
    </div>
    

    You can also pass, into jQuery, the containment option:

    <div class="sortable" data-bind="sortable: { data: blueprint.pages, options: { containment: 'parent' } }">
        <tr><td>Blabla</td></tr>
    </div>
    
    <div class="sortable" data-bind="sortable: { data: selectedPage().page_sections, options: { containment: 'parent' } }">
          <tr><td>Another blabla</td></tr>
    </div>
    

    This, unlike the first solution, will stop the item from visually leaving the box (if that’s your desire).

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

Sidebar

Related Questions

I have a page that requires jQuery.tmpl, but I want to use native knockout
I'm trying to use knockout to do a pretty basic binding but am having
I’ve been using Knockout.js quite extensively but there’s one pattern I use a lot
I can implement Mvvm with Knockout.js. But I want to use it with cross
I was hoping to use knockout to build an updatable jstree. I am able
For some reason knockout requires jquery tmpl when you use databound templates, otherwise it
When I use '.pop' or '.remove', knockout automatically removes the elements corresponding in html
I am writing a custom binding to use $.expandingTextarea with Knockout.js . Following the
Use Case Show a photo uploaded by the user in a square box with
I am trying to use knockout to bind a click to a row in

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.