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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:14:32+00:00 2026-05-27T02:14:32+00:00

I have two problem, This nestedSortable is not working in this code, where’s the

  • 0

I have two problem,

  1. This nestedSortable is not working in this code, where’s the problem ?

  2. I want to block a user to drag an sub-element to the top level (base), i know the library does not allow it, is there a tweak ?

Here is all my code :

 <html>
     <head>
        <style>
            html {
            background-color: #eee;
            }

            body {
            color: #333;
            background-color: #fff;
            font-size: 13px;
            font-family: "Helvetica Neue", Corbel, "Nimbus Sans L", Helvetica, Arial, sans-serif;
            padding: 2em 4em;
            width: 860px;
            margin: 0 auto;
            }

            pre, code {
            font-size: 12px;
            }

            pre {
            width: 100%;
            overflow: auto;
            }

            small {
            font-size: 90%;
            }

            small code {
            font-size: 11px;
            }

            .placeholder {
            background-color: #cfcfcf;
            }

            .ui-nestedSortable-error {
            background:#fbe3e4;
            color:#8a1f11;
            }

            ul{
            margin: 0;
            padding: 0;
            padding-left: 30px;
            }

            ul.sortable, ul.sortable ul{
            margin: 0 0 0 25px;
            padding: 0;
            list-style-type: none;
            }

            ul.sortable {
            margin: 4em 0;
            }

            .sortable li {
            margin: 7px 0 0 0;
            padding: 0;
            }

            .sortable li div {
            border: 1px solid black;
            padding: 3px;
            margin: 0;
            cursor: move;
            }

            h1 {
            font-size: 2em;
            margin-bottom: 0;
             }

             h2 {
             font-size: 1.2em;
             font-weight: normal;
             font-style: italic;
             margin-top: .2em;
             margin-bottom: 1.5em;
             }

             h3 {
             font-size: 1em;
             margin: 1em 0 .3em;;
             }

             p, ol, ul, pre, form {
             margin-top: 0;
             margin-bottom: 1em;
             }

             dl {
             margin: 0;
             }

             dd {
             margin: 0;
             padding: 0 0 0 1.5em;
             }

             code {
             background: #e5e5e5;
             }

             input {
             vertical-align: text-bottom;
             }

             .notice {
             color: #c33;
             }


        </style>
        <script  src='https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js' type='text/javascript'/>
        <script  src='http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.js' type='text/javascript'/>
        <script  src='http://mjsarfatti.com/sandbox/nestedSortable/jquery.ui.nestedSortable.js' type='text/javascript'/>
        <script type='text/javascript'>
                 $(document).ready(function(){

                     $('ul.sortable').nestedSortable({             
                         disableNesting: 'no-nest',
                               forcePlaceholderSize: true,
                                handle: 'div',
                                helper:    'clone',
                               items: 'li',
                                maxLevels: 3,
                                opacity: .6,
                                placeholder: 'placeholder',
                                revert: 250,
                                tabSize: 25,
                                tolerance: 'pointer',
                                toleranceElement: '> div'
                     }); });


        </script>
    </head>
    <body>

        <ul class="sortable">         
             <li id="list_1"><div>Item 1</div> </li>
             <li id="list_2"><div>Item 2</div> </li>
                    <ul>
                       <li id="list_3"><div>Sub Item 2.1</div> </li>
                        <li id="list_4"><div>Sub Item 2.2</div> </li>
                       <li id="list_5"><div>Sub Item 2.3</div> </li>
                        <li id="list_6"><div>Sub Item 2.4</div> </li>
                    </ul>
                <li id="list_7" class="no-nest"><div>Item 3 (no-nesting)</div> </li>
                <li id="list_8" class="no-nest"><div>Item 4 (no-nesting)</div> </li>
                <li id="list_9"><div>Item 5</div> </li>
                <li id="list_10"><div>Item 6</div> </li>
                    <ul>
                        <li id="list_11"><div>Sub Item 6.1</div> </li>
                        <li id="list_12" class="no-nest"><div>Sub Item 6.2 (no-nesting)</div> </li>
                        <li id="list_13"><div>Sub Item 6.3</div> </li>
                       <li id="list_14"><div>Sub Item 6.4</div> </li>
                    </ul>        <li id="list_15"><div>Item 7</div> </li>
                <li id="list_16"><div>Item 8</div> </li>
            </ul>
    </body>
</html>

Thanks ! 🙂

EDIT : here is a working exemple http://mjsarfatti.com/sandbox/nestedSortable/
If I can only get this work, maybe I could look more for my second point

EDIT 2 : I’Ve changed the library as one of the answer told me, but firefox is hanging and there’s un unresponsive script

Here is the fiddle : http://jsfiddle.net/dAwEe/2/

EDIT 3 : Someone have an idea ?

EDIT 4 : http://jsfiddle.net/dAwEe/3/ I’ve fixed my problem one : The nested sortable js was not well include :S

Now someone have an idea for the problem two ?

  • 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-27T02:14:33+00:00Added an answer on May 27, 2026 at 2:14 am

    I modified the code a little with $.extend() and I think I came pretty close –> http://jsfiddle.net/Galled/dAwEe/85/

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

Sidebar

Related Questions

I've run into this problem with testing. Let's assume I have two models, User
I have a problem with this very simple block of code. please give me
My problem is this: I have two threads, my UI thread, and a worker
I am wondering how you would approach this problem I have two Taxrates that
So i'm having this problem. I have two tables (Oracle), one is called Destination
I have had this problem w/ two seperate WYSWYG editors in my rails application
I have this little problem. My client wanted two distinct swf on a web
I have a problem with IE causing two errors: 1. Object doesn't support this
i have two problem with this jquery method : 1- in css hover and
This problem has been driving me mad. Here's the general gist: I have two

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.