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

The Archive Base Latest Questions

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

I have a knockout sortable list with knockout sortable lists inside it. Essentially it

  • 0

I have a knockout sortable list with knockout sortable lists inside it. Essentially it is the basic ‘available student’ example (http://jsfiddle.net/rniemeyer/UdXr4/), only I want the tables to be sortable as well.

I have this working mostly, but I have a problem with being able to drag tables into other tables.

I was able to add an allowDrop function on the table list to prevent students from being dropped into the table list,

        this.isTable = function(arg) {
            return arg.sourceParent != undefined;
        };

so I was hoping to have something similar on the student lists that wouldn’t allow a table in, but for the life of me I cannot figure it out. Ive tried looking at the id, or even seeing if the gender property is available (because it should only be on students) to no avail…

Ive edited a jsfiddle to make it more similar to my situation; you’ll see if you drag a table you can drop it into another table.
http://jsfiddle.net/nYSLq/1/

Any help or suggestions would be greatly appreciated.

  • 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-15T14:35:48+00:00Added an answer on June 15, 2026 at 2:35 pm

    For this type of thing, a good choice is to use the connectClass option. This will help classify the type of containers that items can be dropped into.

    So, you could do:

    <div id="main" data-bind="sortable: { data: tables, connectClass: 'tables' }">
        <div class="table">
            <div data-bind="text: students.id"></div>
            <div class="seats" data-bind="sortable: { data: students, allowDrop: $root.isTableFull, connectClass: 'students'  }">
                <div class="student" data-bind="text: name"></div>
            </div>
        </div>
    </div>
    

    Note that the plugin, does assign that class to the appropriate elements for you.

    Now, students will only sort with students and tables will only sort together.

    Here is an updated fiddle with some of the unnecessary extras stripped out: http://jsfiddle.net/rniemeyer/7yA2s/

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

Sidebar

Related Questions

Example Problem: http://jsfiddle.net/whxD3/12/ In knockout I have a select box that I want to
I have a problem that is summarized in this simple example: http://jsfiddle.net/2wFHX/ I need
I have this basic knockout script set up (still learning) $.getJSON(clientUrl + /list/ +
I have an ASP .NET MVC application, additonally I am using Knockout 2.0.0. I
I am having trouble getting this to work: http://jsfiddle.net/2jg2F/1/ I basically want to make
Possible Duplicate: Sortable and droppable knockout list I am using knockout to bind a
I have a Knockout.JS observable array that is the basis for a list: self.list_elements
I'm attempting to use the knockout sortable plugin to work with two html lists
Currently I have a knockout binding that stripes rows in a list which works
I have a knockout template like this: <script type=text/html id=list> <ul data-bind=foreach: items> <li

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.