Em Sexta 09 Junho 2006 11:50, Arnar Birgisson escreveu:
>
> map(function (key) {
> $('yourselect').appendChild(OPTION({'value': key}, yourjsonobject[key]));
> }, keys(yourjsonobject).sort());
This will sort based on the "key", not based on what is shown to the user...
E.g.:
TODAY
-----
1 -> Something
2 -> Another Thing
3 -> Yet Another Thing
DESIRED
-------
2 -> Another Thing
1 -> Something
3 -> Yet Another Thing
I'm trying to do that so that users can search alphabetically when they open
the select options. The key is used only internally and is unique across
several conditions that might lead me to repeated values if I looked the
other way around (I'd have to pass more information to make this 'thing'
unique and I would like to avoid several "hidden" informations...).
--
Jorge Godoy <[EMAIL PROTECTED]>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"MochiKit" 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/mochikit
-~----------~----~----~----~------~----~------~--~---