Paul, I wrote a little page that demonstrates the problem I'm having sorting items that are added to a list after the sortable was created (unless I'm doing something wrong - which NEVER happens!!! <lol>
1. Download the attached .html file and open it in your browser. You can drag-drop sort the three divs. 2. Now click on the "Add new div" link at the top. 3. Try to drag it to a new position relative to the original divs. 4. See source for code. It's mercifully short. --Larry Siden The United States is a nation of laws; poorly written and randomly enforced. -- Frank Zappa On Wed, Jan 7, 2009 at 9:50 AM, Paul Bakaus <[email protected]>wrote: > The refresh function should actually do the job. Could you post your test > case maybe? > > Thanks, > Paul > > > On Tue, Jan 6, 2009 at 5:53 PM, Larry Siden <[email protected]> wrote: > >> Does anyone know how to create a sortable list that you can continue to >> add items to dynamically that can also be drag/drop sorted with the original >> items? >> >> I'm using jQuery on a site that manages a sortable list, to which items >> can be added dynamically (Ajax) after the page has been downloaded and >> rendered. I apply $(container).sortable({...options...}) to them and >> everything works like a charm, but items that I add to the container after >> that won't respond to mouse events (click and drag). I tried calling >> $(container).sortable("refresh"), and even tried re-initializing the list by >> calling $(container).sortable({options...}) after each item is added, but >> the new items still won't respond to mouse events. >> >> Does anyone know how to do this? >> >> --Larry Siden >> >> The United States is a nation of laws; poorly written and randomly >> enforced. >> -- Frank Zappa >> >> >> > > > -- > Paul Bakaus > UI Architect > -- > http://paulbakaus.com > http://www.linkedin.com/in/paulbakaus > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en -~----------~----~----~----~------~----~------~--~---Title: test drag/drop issue
handle
Div 1
Vestibulum vehicula, libero quis consectetur facilisis, libero nunc malesuada nibh, vel lacinia velit felis vitae lectus. Nullam mi. Curabitur dui. Aenean vel ante vel massa tempor laoreet. Vivamus elementum, magna ac mattis dictum, lacus odio ultrices felis, et venenatis lacus quam a est. Proin pretium pede quis pede. Donec sit amet velit ut nisi dapibus convallis. Aenean dignissim tincidunt metus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Praesent placerat nunc et lorem. Sed placerat. Cras semper gravida nisi. Aliquam eget nibh.
handle
Div 2
Vestibulum vehicula, libero quis consectetur facilisis, libero nunc malesuada nibh, vel lacinia velit felis vitae lectus. Nullam mi. Curabitur dui. Aenean vel ante vel massa tempor laoreet. Vivamus elementum, magna ac mattis dictum, lacus odio ultrices felis, et venenatis lacus quam a est. Proin pretium pede quis pede. Donec sit amet velit ut nisi dapibus convallis. Aenean dignissim tincidunt metus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Praesent placerat nunc et lorem. Sed placerat. Cras semper gravida nisi. Aliquam eget nibh.
handle
Div 3
Vestibulum vehicula, libero quis consectetur facilisis, libero nunc malesuada nibh, vel lacinia velit felis vitae lectus. Nullam mi. Curabitur dui. Aenean vel ante vel massa tempor laoreet. Vivamus elementum, magna ac mattis dictum, lacus odio ultrices felis, et venenatis lacus quam a est. Proin pretium pede quis pede. Donec sit amet velit ut nisi dapibus convallis. Aenean dignissim tincidunt metus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Praesent placerat nunc et lorem. Sed placerat. Cras semper gravida nisi. Aliquam eget nibh.
