In the customized autocomplete demo, how does it know what content to use as the value of the autocomplete? The returned UL has the name, email address and an image. Yet only the name is used. How does it do this? I''ve been trying to get something similar going all morning with little success. Also, what does :skip_style=>true do? I couldn''t seem to find a mention of it in the docs. Thanks in advance. -- R.Livsey http://livsey.org
Hi, On 8/15/05, Richard Livsey <richard@livsey.org> wrote:> In the customized autocomplete demo, how does it know what content to > use as the value of the autocomplete?When an item is selected from the dropdown, selectEntry is called, and this in turn calls updateElement. You can override updateElement by passing your function as a parameter in the ''option'' section. Someone should update the wiki with a wee howto. I''ll do it tomorrow morning if no-one else does... Cheers, Rob.> > The returned UL has the name, email address and an image. Yet only the > name is used. > > How does it do this? I''ve been trying to get something similar going all > morning with little success. > > Also, what does :skip_style=>true do? I couldn''t seem to find a mention > of it in the docs. > > Thanks in advance. > > -- > R.Livsey > http://livsey.org > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs >-- Rob Sharp email/jabber: rob@sharp.id.au web: http://sharp.id.au pgp: 0E2C C63B BA04 DEB4 7CC0 84FD 17E3 6AA4 87FB 62DF -- Rob Sharp email/jabber: rob@sharp.id.au web: http://sharp.id.au pgp: 0E2C C63B BA04 DEB4 7CC0 84FD 17E3 6AA4 87FB 62DF
I hit this a few weeks ago. I believe you''re looking for the magic "class=''informal''" declaration. You''ll see it in the demo tags. Whatever text in the <LI> will get returned unless the text is in a tag with the ''informal'' class. If it''s ''informal'' it won''t be returned. The name is a little subtle/counterintuitive... -San --- Richard Livsey <richard@livsey.org> wrote:> In the customized autocomplete demo, how does it > know what content to > use as the value of the autocomplete? > > The returned UL has the name, email address and an > image. Yet only the > name is used. > > How does it do this? I''ve been trying to get > something similar going all > morning with little success. > > Also, what does :skip_style=>true do? I couldn''t > seem to find a mention > of it in the docs. > > Thanks in advance. > > -- > R.Livsey > http://livsey.org > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs@lists.rubyonrails.org >http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs>____________________________________________________ Start your day with Yahoo! - make it your home page http://www.yahoo.com/r/hs
sanzbox@yahoo.com wrote:>I hit this a few weeks ago. I believe you''re looking >for the magic "class=''informal''" declaration. You''ll >see it in the demo tags. > >Whatever text in the <LI> will get returned unless the >text is in a tag with the ''informal'' class. If it''s >''informal'' it won''t be returned. > >The name is a little subtle/counterintuitive... > >Brilliant, that did the trick, thanks. I had looked through the source for the demo and wondered what ''informal'' meant, but like you say it''s a bit subtle and I didn''t try it. It would be good if that could be changed, or at least add some synonyms like ''exclude''. Maybe even make it quite explicit, like ''autocomplete_exclude''. A bit wordy perhaps. Thanks again. -- R.Livsey http://livsey.org
''exclude'' or ''autocomplete_exclude'' sound like much better names. Thomas, any objections to adding a synonym? ''exclude'' (or some equivalent) feels much more intuitive. -San --- Richard Livsey <richard@livsey.org> wrote:> sanzbox@yahoo.com wrote: > > >I hit this a few weeks ago. I believe you''re > looking > >for the magic "class=''informal''" declaration. > You''ll > >see it in the demo tags. > > > >Whatever text in the <LI> will get returned unless > the > >text is in a tag with the ''informal'' class. If > it''s > >''informal'' it won''t be returned. > > > >The name is a little subtle/counterintuitive... > > > > > Brilliant, that did the trick, thanks. > > I had looked through the source for the demo and > wondered what > ''informal'' meant, but like you say it''s a bit subtle > and I didn''t try it. > > It would be good if that could be changed, or at > least add some synonyms > like ''exclude''. > Maybe even make it quite explicit, like > ''autocomplete_exclude''. A bit > wordy perhaps. > > Thanks again. > > -- > R.Livsey > http://livsey.org > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs@lists.rubyonrails.org >http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs>____________________________________________________ Start your day with Yahoo! - make it your home page http://www.yahoo.com/r/hs
On 8/15/05, sanzbox@yahoo.com <sanzbox@yahoo.com> wrote:> ''exclude'' or ''autocomplete_exclude'' sound like much > better names. > > Thomas, any objections to adding a synonym? ''exclude'' > (or some equivalent) feels much more intuitive.I''ve attached a patch that allows an array of strings (or a single string) to be passed into collectTextNodesIgnoreClass, which is the method that ignores ''informal'' when called by updateElement. You could then over-ride updateElement and pass in an array of strings instead of ''informal''. This avoids applying arbitary classes to elements to define whether an element should be used for the input control or not. May be useful to someone else! Cheers, Rob. -- Rob Sharp email/jabber: rob@sharp.id.au web: http://sharp.id.au pgp: 0E2C C63B BA04 DEB4 7CC0 84FD 17E3 6AA4 87FB 62DF -------------- next part -------------- A non-text attachment was scrubbed... Name: arrayIgnoreClass.patch Type: text/x-patch Size: 858 bytes Desc: not available Url : http://wrath.rubyonrails.org/pipermail/rails-spinoffs/attachments/20050815/4f6ea2c5/arrayIgnoreClass.bin