From: Thomas Wedderburn-B. <web...@bi...> - 2008-12-22 02:51:43
|
Funny, I've just finished implementing exactly that. Never mind the man behind the curtain. If you set the binding for the inner sortable list to an NSArray (eg items) then that will be set during the repetition, and the values in it during evaluation of the action will be the sorted items in that sub-list, at that point in the loop eg for the inner loop: <wo:AjaxSortableList id="~#a='itemsort'+ aChecklistGroup.primaryKey,#a" action="$reorderItems" list="$items" item="$aChecklistItem" listItemClass="listItem" listClass="checklistItems" listItemIDKeyPath="primaryKey"> So in reorderItems() I just iterate through the list and set their sequence number appropriately. Regards Thomas On 22/12/2008, at 1:33 PM, Paul Hoadley wrote: > Hello, > > I have a model where I have Sections that contain Items. Sections are > ordered on an integer attribute, and Items are ordered within their > parent Section on an integer attribute. > > Ideally, I'd like to offer re-ordering of Sections and Items in a > single interface, so I thought I could nest AjaxSortableLists. (Even > more ideally, I'd also offer the ability to move an Item from one > section to another with the same interface, though that isn't > necessary initially.) Setting up the outer list is easy. I'm now > trying to add an inner list for the Section's items, and it's getting > a bit hairy. In particular, it's the action method that changes the > attributes according to the new order: it's obviously the same method > name for all of the inner lists. Is there a way for that method to > know which component called it, or is this supposed to be strictly > 1:1? (Beyond that I'll need to keep track of the variable number of > NSMutableArrays for the inner lists, but I could do that with an > NSDictionary where the key is the parent Section, I suppose.) > > Anyway, has anyone done anything like this with AjaxSortableList? Is > there a better way? > > > -- > Paul. > > w http://logicsquad.net/ > h http://paul.hoadley.name/ > > > > ------------------------------------------------------------------------------ > _______________________________________________ > Wonder-disc mailing list > Won...@li... > https://lists.sourceforge.net/lists/listinfo/wonder-disc |