I have not dug into this at all and I may determine that I don''t need it. But it appears as if there is no way to send back a list of options grouped in optgroups when the list is fetched from a server. Is that true or did I miss something? Has any other work been done on this? Any thoughts on the format of what to return in order to accomplish this? The obvious choice is something like: [ option, option, [ groupname, [ option, option, option ] ], [ groupname, [ option, ... ], ... ] Determining when a groupname is an option group name and not an option may be tricky but if the length of the element is two and the second element is an array, then assume it is a group with the first element as the group name and the second element the list of options within that group. Anyone agree or disagree? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
pedz a écrit :> I have not dug into this at all and I may determine that I don''t need > it. But it appears as if there is no way to send back a list of > options grouped in optgroups when the list is fetched from a server. > > Is that true or did I miss something?That is indeed correct. This is because the current implementation of the buildOptionList method relies on a simple array, whose elements may be either single values (then used as both value and text), or 2-item arrays (first is value, second is text). If that''s an actual issue for you, you could monkeypatch buildOptionList to handle an alternate case, where, say, an entry would be a 2-item array and the second member of it is itself an array. With some recursive coding, it could deal with <optgroup>''s to any depth. -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---