views:

19

answers:

0

Hi,

Sorry to bother anyone with this but about to go mad. Using jQuery UI Sortable with a nested list. Loading the nodes of the "tree" dynamically, so have a button which 'loads node' (similar to ASP.NET TreeView) - when this button is pressed and the node is loaded, I want to either "refresh" or "destroy" then re-initialize the sortable (whichever's less processor intensive) so that the new node becomes sortable.

However, even though I initialize sortable at page load, then wait for the next UL to be loaded in via AJAX, and THEN call the sortable method (either "destroy" or "refresh") I always get the same error:

cannot call methods on sortable prior to initialization

Has anybody experienced a similar error? I don't know if it's worth posting all my code because the problem is exactly as I describe it and I've spent 3 hours tearing my hair out!

If anyone can help at all I'd be very grateful.

Thanks, Rob