Hello everyone, Here is my response for autocompletion request: <ul> <li testID="1">Test A</li> <li testID="2">Test B</li> <li testID="3">Test C</li> </ul> How can i handle testID? Thank you for your time, Umut --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Christophe Porteneuve
2007-Jun-01 09:32 UTC
Re: Can i handle attributes on autocompletion?
Hey, phpist a écrit :> <ul> > <li testID="1">Test A</li> > <li testID="2">Test B</li> > <li testID="3">Test C</li> > </ul>Er, first, you do know that this is not valid HTML, right? A more scriptaculous''ish option would be to put it like this: <li><span class="informal">1</span>Test A</li> ... Then style .informal to "display: none". It will automatically *not* be used for visual completion of your edit zone, too.> How can i handle testID?Use the afterUpdateElement callback, which gets passed the selected <li> item as its second argument. Then just use readAttribute(''testID'') on it. Or if you went with the informal stuff, you can either use: yourLI.getElementsByClassName("informal").firstChild.nodeValue or: yourLI.firstChild.firstChild.nodeValue The first variant reacts better to change in your <li> structure, but is slower. The second is faster but structure-dependent. ''HTH -- 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 -~----------~----~----~----~------~----~------~--~---
Thank you again Christophe, It''s my fault. There is an example at: http://wiki.script.aculo.us/scriptaculous/show/Ajax.Autocompleter Thank you for your time, Umut --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---