Alternative for <option> & event delegation

R

Richard Maher

Hi,

I've been interested in the recent thread on Event Delegation and thought I
had an immediate use for it with a <select> list that I build on-demand at
run-time. One problem, as many others have discovered before me, is that IE
and Safari aren't big on mousover events sourced from <option> tags :-(

So I can: -

a) Stick to only onclick events in the select list

or

b) Use a List or Table or (a.n.other) html construct that supports
onmouseover, and gives me drop-down menu functionality.

.. What I'd like to achive is achieve the Google-Suggest-esque functionality
on various input fields.
.. I retrieve the options one row at a time via a Java Socket and would like
to leverage the option-level granularity if I can. (IOW a progressive
population of the options rather than an innerHTML squirt or such)
.. I don't want to use someone else's JS library or widget
.. This is just by way of example and it doesn't have to be swish
.. If it is something other than "suggest.options[suggest.length] = new
Option(foo, bar)" then please assist with any performance tips on
cloning/replacing the table or the most optimum way to append/delete child
nodes

Cheers Richard Maher
 
D

David Mark

Hi,

I've been interested in the recent thread on Event Delegation and thoughtI
had an immediate use for it with a <select> list that I build on-demand at
run-time. One problem, as many others have discovered before me, is that IE
and Safari aren't big on mousover events sourced from <option> tags :-(

So what?
So I can: -

a) Stick to only onclick events in the select list

Why would you care about mouseover events on options?
or

b) Use a List or Table or (a.n.other) html construct that supports
onmouseover, and gives me drop-down menu functionality.

Trying to re-invent form controls is one of the worst things you can
do (usually done to make them look slightly different than native form
controls). But it sounds like you want something else here.
. What I'd like to achive is achieve the Google-Suggest-esque functionality
on various input fields.

Google doesn't have a patent on those.
. I retrieve the options one row at a time via a Java Socket and would like
to leverage the option-level granularity if I can. (IOW a progressive
population of the options rather than an innerHTML squirt or such)

Then you will need a text input and a list.
. I don't want to use someone else's JS library or widget

Good idea. And don't copy Google's. ;)
. This is just by way of example and it doesn't have to be swish

Doesn't have to be what? Unless that is a new term for God-awful,
such examples don't exist (at least not on the Web).
. If it is something other than "suggest.options[suggest.length] = new
Option(foo, bar)" then please assist with any performance tips on
cloning/replacing the table or the most optimum way to append/delete child
nodes

I wouldn't suggest that as I wouldn't suggest using a SELECT for
suggestions. I would use appendChild to add list items to a list.
 
R

Richard Maher

Hi David,

Thanks for the reply.

I wouldn't suggest that as I wouldn't suggest using a SELECT for
suggestions. I would use appendChild to add list items to a list.

Will do. Just checking that a removeChild on tthe <ul> from, in my case,
<div> is all I need to do to free up the memory/resources before another
load of the list?

Cheers Richard Maher
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top