--- In ydn-javascript%40yahoogroups.com">ydn-javascript
yahoogroups.com, Fiouz <fiouzy
...> wrote:
>
> Try subscribing to the itemMouseOverEvent/itemArryToEvent events to
> remember the last "hovered/arrowed" item:
>
> var rememberItem = function (eventType, eventArgs, sharedObject) {
> var item = eventArgs[1];
> sharedObject.currentItem = item; // store the item reference in
> some shared object
> };
> yourAutoComplete.itemMouseOverEvent.subscribe(rememberItem,
> sharedObject); // mouse navigation
> yourAutoComplete.itemArrowToEvent.subscribe(rememberItem,
> 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><u>Sta</u></b>tes</div>. I'd then have to parse this to
get 'United States'. Any better way than this?
.