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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:10:47+00:00 2026-05-23T03:10:47+00:00

I have a <ul> tag that is hardcoded in my markup: So, something like:

  • 0

I have a <ul> tag that is “hardcoded” in my markup:

So, something like:

<ul id='myList'></ul>

and then I have this:

$(document).ready(function() {
//Some code
   $("#myList").sortable();
//Some more code
});

Now, my issue lies when I update the <ul> dynamically with a button click. The list in question gets generated by the user at runtime. So, when the page loads with some data in it (it’s all stored in the database) the <li> objects are all listed properly and created as expected as .sortable(). Once I add a new entry, the entire list reverts to a list with bullet points showing, and no longer .sortable();. When the user enters data, the data is stored to the data and returned to the client via JSON (ie. no postback).

So, my question is, is there a way to re-bind the .sortable(); on the fly so that the list never falls back to a standard <li> element and will always be .sortable();?

  • 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-23T03:10:48+00:00Added an answer on May 23, 2026 at 3:10 am

    I created a fiddle based on your code. Is there something I’m missing – I’m not seeing the behavior that you describe. I’m using jQuery 1.6.0 (since jsFiddle doesn’t have an option for 1.6.1). But I’m using jQueryUI 1.8.13 (black tie theme, which doesn’t really mean much 🙂 ).

    I didn’t need to do a refresh on sortable – my list updates without reverting to a basic <UL>.

    Let me know what I’m missing and I can further refine the fiddle.

    Hope this helps.

    EDIT:
    I made some changes to my fiddle based on your comment. It’s not 100% the same, as jsFiddle only allows POSTs for JSON echo requests, but I think it’s close. I still didn’t have to do a sortable refresh; I just emptied the contents of the outer <UL> and then rebuild the <LI> elements.

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

Sidebar

Related Questions

If I have a script tag like this: <script id = myscript src =
I have several data that looks like this: Vector1_elements = T,C,A Vector2_elements = C,G,A
I have just written some code, which as i was writing i thought, this
I have a Div tag that for some reason is padding the left side
I have a .tag file that requires a JavaScript library (as in a .js
I have an img tag in my webapp that uses the onload handler to
I have a <table/> in a ViewUserControl that I have given the tag a
I have an element that is similar to a tag (because it has word-wrap:
I have: image 1:Many imageToTag Many:1 tag I want to issue a query that
Embedded custom-tag in dynamic content (nested tag) not rendering. I have a page that

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.