views:

237

answers:

2

Have tried everything to get this working. Basically within each portlet there are 2 sections and users should be able to drag items from one section to the other (within the same portlet). As the sortables are generated dynamically, have tried to do something similar by creating a variable for connectWith, but keep getting javascript error when I include the connectWith line.

See: http://www.nimr.mrc.ac.uk/ttest/090209/nimri_c.html

Any pointers much appreciated. :)

A: 

instead of doing $("#list1, #list1-hide").sortable and $("#list2, #list2-hide").sortable seperately and trying to connect the two why don't you try just doing:

$("#list1, #list1-hide, #list2, #list2-hide").sortable
WibblePoop
A: 

Oops, guess I didn't give enough info. Those 2 blocks of commented out code should have f them to been deleted (sorry). (Was used but conflicted with cookie code which is within the .each)

Also, I don't want the user to be able to move list items from list1 to list2, etc. list1 items should be able to go to list1-hide (and vice versa, etc).

The line of code that's the issue is within the .each function -

// here, we allow the user to sort the items
 $(setSelector).sortable({

  //connectWith:['?'], // connect with connectMe 
  update: function() {   
    $.cookie(setCookieName, $(setSelector).sortable("toArray"), { expires: 7, path: "/" });   
  }

 });

Thanks! ScoobySnack

Have now removed code that was causing confusion
Ok, have managed to get the connectWith working, but now cookies no longer work. :|