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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:08:01+00:00 2026-06-09T00:08:01+00:00

I have three connected sortable lists using JqueryUI : list1, list 2 and list

  • 0

I have three connected sortable lists using JqueryUI: list1, list 2 and list 3. Particular items in List 1 have the class number. If these number items are dragged then they can only be dropped into list 2 BUT NOT into list 3. How do I find out which list I am about to drop it in?

$("#list1").sortable({
    start: function(event, ui) { 
        beforeStop: function (event, ui) {
            if ($(ui.item).hasClass("number")) {
                //Check which list is targeted
                //If List 3 then 
                //$(List 3).sortable('cancel');
                //End If
            }
        }
    }
});
  • 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-09T00:08:02+00:00Added an answer on June 9, 2026 at 12:08 am

    You could check the item on the update event. From the jQuery documentation:

    This event is triggered when the user stopped sorting and the DOM position has changed.

    Something like this might work for you:

    update: function (e, ui) {
        var target = ui.item;
        var parent = item.closest('ul');
        if (parent.hasClass('thirdList')) {
            // do stuff
        }
        else {
            // do stuff
            return false;
        }
    }
    

    From what I understand of your situation, I don’t think it would be necessary to check for the class number, since you can allow sorting for only the items that have class number.

    Edit:

    If you don’t want to be able to drag into list 3 at all, you can just not make it sortable from when the page loads and have the other lists sortable:

    $(function () {
        $('#list1').sortable({
            items: '.number'
        });
        $('#list2').sortable();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have three list that all of them are connected with jquery-ui sortable, first
I am using this method http://jqueryui.com/demos/sortable/#connect-lists to connect two lists that i have. I
i have three lists with the same number of elements in each other, i
I have three models connected via an has_many_through association. class Board < ActiveRecord::Base has_many
I have a sortable list of videos initialised with the option: items: '.videoBox:not(.isFirst, .isLast)',
I have connected sortable list and I want to have a callback function for
I have three entities: EntityA, EntityB and EntityC connected with to-many relationships. See schema
I have three tables. I have to retrieve the data using Linq statement. My
On a page I have a sortable list with thumbnails. When rolling over the
I'm working with connected sortable lists and need the ability to add an extra

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.