Hi Larry,
you're in fact doing something wrong this time :)
In the script, you are using the 'items' options this way:
items: jQuery('.sub')
this 'kind of' works, but it creates a cached set of items, that has no
chance to update itself later, this is why in the documentation, we suggest
using a string of the selector instead:
items: '.sub'
everything works fine then!
Cheers,
Paul
On Fri, Jan 9, 2009 at 7:12 AM, Larry Siden <[email protected]> wrote:
> 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
>>
>> >>
>>
>
--
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
-~----------~----~----~----~------~----~------~--~---