This seems to work: $('ul').each(function(i) { var className = 'sort' + i; $(this).children("li").addClass(className); $(this).Sortable({accept: className}); });
As far as building this into sortables, time is likely better spent on jQuery UI sortables rather than Interface. Interface is still an official plugin, but as far as I know it is in maintenance mode (bug fixes only) and all new development (which this would fit under) is happening in jQuery UI. Sortables (along with the rest of jQuery UI) is under active development (pre-alpha, and likely to change a lot over the next month or so leading up to jQuery UI 1.0). If you have any suggestions/preference on the API for such a feature, I suggest starting a new thread on the jquery-ui list. - Richard On 7/24/07, rayfidelity <[EMAIL PROTECTED]> wrote:
So what would be an alternative (if there is one)? Any suggestions on how to easily implement this feature? On Jul 24, 4:26 pm, "Richard D. Worth" <[EMAIL PROTECTED]> wrote: > It's not going to be super easy as there's no built-in support for nested > sortables in Interface. The accept option may help. I haven't tested it, but > even if it worked, I'm guessing it would require a unique class name on all > LIs of each sortable UL. One work-around I've used before: > > Call .Sortable() on only the parent UL (and maybe SortableAddItem on the > LIs) at the moment you want to begin sorting its children (I've done it with > a context menu, can be accomplished by other means - perhaps > draggable.onStart). Then destroy the sortable when sorting in that list is > done. This way only one list is sortable at a time. > > - Richard > > On 7/23/07, rayfidelity <[EMAIL PROTECTED]> wrote: > > > > > Hello, > > > I have a nested list and i'd like to lock the sortable option to the > > each level (so that it wouldn't be possible to drag the selected > > element to the another level). > > > I was looking at the documentation on the interface plugin site > > (http://interface.eyecon.ro/docs/sort) but i didn't find such an > > option... > > > Does anywan know if this is possible? > > > I'm also wondering how to submit the resorted list?