List Info

Thread: Re: YUI Autocomplete and context menu




Re: YUI Autocomplete and context menu
country flaguser name
United States
2008-03-30 11:14:29

--- In ydn-javascript%40yahoogroups.com">ydn-javascriptyahoogroups.com, Fiouz <fiouzy...> wrote:
&gt;
> Try subscribing to the itemMouseOverEvent/itemArryToEvent events to
> remember the last "hovered/arrowed" item:
&gt;
> var rememberItem = function (eventType, eventArgs, sharedObject) {
> var item = eventArgs[1];
> sharedObject.currentItem = item; // store the item reference in
> some shared object
&gt; };
> yourAutoComplete.itemMouseOverEvent.subscribe(rememberItem,
> sharedObject); // mouse navigation
> yourAutoComplete.itemArrowToEvent.subscribe(rememberItem,
&gt; sharedObject); // keyboard navigation
>

Thanks, this makes sense. I'm not sure how easy it is then to work
with the result since 'item' is an HTMLLIElement. I can use innerHTML
but, given an example where the autocomplete is for countries and the
entered query string is 'sta' and given that I'm formatting the
result this could be something like <div id="ysearchresult">;United
<b&gt;<u>Sta</u&gt;</b&gt;tes</div>. I'd then have to parse this to
get 'United States'. Any better way than this?

__._,_.___
.

__,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )