No satisfactory answers yet but since I was in a hurry I came across the hack shown below, if it can help anyone w/ the same problem. It consists in using jQuery to sort the items, after the view has been rendered.
This is based on what found in http://www.wrichards.com/blog/2009/02/jquery-sorting-elements/ (note: jQuery has the sort() function since). let sortby_id_item=function(a,b){return parseInt(a.getAttribute ("id_item")) > parseInt(b.getAttribute("id_item")) ? 1 : -1 }; $("div.directory-lens:visible").each(function(i){ let l = $(">ul>li", this); let p = l.parent(); l.remove().sort(sort1).appendTo(p); }); On Sep 3, 12:36 pm, Sacha <[email protected]> wrote: > Hi everyone, > > I have an question about sub-lenses in Exhibit. > > I've been trying to use sublenses lately, and I was wondering is there > is a way to choose the order the subitems are being displayed. > > For instance using the <li> element below as a sublens to display > title of files belonging to a given directory: > > <div ex:role="lens" class="directory-lens" ex:itemTypes="directory" > > <span ex:content=".name"/> > <ul ex:content="!directory" ex:orders=".title"><li><a ex:href- > subcontent="#{{.title}}" ex:content=".title"></a></li></ul> > </div> > > ...I get something like that ('Lectures' and 'My Files' are the > directories). > > Lectures > * lec10.pdf > * lec03.pdf > * lec05.pdf > * lec06.pdf > * lec02.pdf > * lec04.pdf > * lec07.pdf > * lec08.pdf > * lec09.pdf > * lec01.pdf > * lec11.pdf > My Files > * Ch01.pdf > * blender_beginner.pdf > * book-draft.pdf > > My question: What if I want to order the files according to some field > (their label, or creation time etc...) ? I've tried adding a ex:orders > attribute to the <ul>, but it doesn't work. Any ideas ? > > Best, > Sacha --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "SIMILE Widgets" 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/simile-widgets?hl=en -~----------~----~----~----~------~----~------~--~---
