Hi Leo,

If you're getting your data from a database, you could easily add a
"random value column" to your query.
For example, in MySQL, you would issue this select statement:
SELECT id, name, RAND() FROM table;

-Mark


On Nov 16, 7:27 am, John Callahan <[email protected]> wrote:
> In my case, I would like to have a different ordering each time a user opens
> the page.  When items are sorted by date, alphabetical, or any static
> property, the same items appear at the top.  I've noticed this most with the
> thumbnail view as the same handful of items are consistently visible at the
> top.
>
> Could this be done in the current code?  Say you have a property in the
> source json that you want to sort on called "myOrderField"  Then, you create
> a javascript mapping function to map these values to a random integer and
> sort on that. Such as ex:directions="myFunction(.myOrderField)".
>
> - John
>
> **************************************************
> John Callahan, Research Scientist
> Delaware Geological Survey, University of Delaware
> URL:http://www.dgs.udel.edu
> **************************************************
>
> On Tue, Nov 16, 2010 at 10:13 AM, David Karger <[email protected]> wrote:
> >  Unclear how "real" the randomness needs to be.  You could assign random
> > numbers to a property called "random" in the _source_ json, which would then
> > provide a random order once.  Of course it wouldn't let you rerandomize on
> > the fly, but does that matter?
>
> > On 11/16/2010 10:08 AM, John Callahan wrote:
>
> > I had the same situation as you and could not find a simple solution
> > either.  It would be great if the directions parameter (in Tile and
> > Thumbnail views) could handle ascending, descending, and random.  Not sure
> > how hard that would be to code up.
>
> > - John
>
> > **************************************************
> > John Callahan, Research Scientist
> > Delaware Geological Survey, University of Delaware
> > URL:http://www.dgs.udel.edu
> > **************************************************
>
> > On Tue, Nov 16, 2010 at 3:12 AM, Leo <[email protected]> wrote:
>
> >> Hi at all!
> >> in my last work I must view my object's list in a random order. But I
> >> don't found how! :-p
> >> Exhibit want at least a possible order of objects with "ex:orders". So,
> >> the only workaround that I found
> >> is to randomize order of my objects in json DB all the times that I open
> >> my page and progressively assign
> >> it a counter (directly in json). Then, I order the view by the counter.
> >> Someone know if exist a simple solution of the problem?
>
> >>             thanks for you response.
> >>                     .hachreak.
> >>  --
> >> 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]<simile-widgets%[email protected]>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/simile-widgets?hl=en.
>
> > --
> > 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.
>
> >  --
> > 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]<simile-widgets%[email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/simile-widgets?hl=en.

-- 
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.

Reply via email to