SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Addict jamus's Avatar
    Join Date
    Jul 2004
    Location
    Devon, UK
    Posts
    301
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Adding objects to jQuery UI Sortable list - possible?

    Hi,

    I hava sortable list using jQuery UI Sortable. When the items are re-ordered the new order is written to the database. All working fine however, if I use jquery to add a new item ....

    Code:
    $('.litodo:first-child').before('<li id="todosArray_300" class="litodo"><a href="" id="300" class="todo active">'+todotext+'</a></li>');
    then this item is 'sortable' on page and even calls the "update order" function but doesn't actually update the database.

    View the example here

    Can some find my bug?!?

  2. #2
    SitePoint Addict jamus's Avatar
    Join Date
    Jul 2004
    Location
    Devon, UK
    Posts
    301
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmmmm tried reading the documentation again.

    $("#sortable").sortable('refresh'); does not seem to help.

  3. #3
    SitePoint Member
    Join Date
    Aug 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have this same problem. Did you find a solution? I tried Jquery sortable('refresh'), adding sortable item with ASP.NET, no sucess.

  4. #4
    SitePoint Addict jamus's Avatar
    Join Date
    Jul 2004
    Location
    Devon, UK
    Posts
    301
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you still having a issue? I did have a solution but can't access the code now. I could post it later if you are?

    If think it may have been to so with the .bind() command but can't be sure from memory.

  5. #5
    SitePoint Member
    Join Date
    Aug 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes. Please. Thanks


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •