• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

How to clear the suggester table on Mouse click outside the table?

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,

I'm having a problem with a suggester table, as it doesn't clear if i click outside the area. Let me explain the problem..

I'm using Ajax call to fetch suggestions as I type into a text box, the results are set inside a <div> using a <table> dynamically. Now, I want to clear/close the suggester table if i click outside the area, just like a normal combo box would behave. When I tried clearing at 'onblur' of the text box, the value selection is also not possible. This, I feel, is because the table is detected as outside of the text box, n hence its closed. What I'd like to know is if there's any way of finding out the target-element, so that i can check whether its the table or outside. Not too sure about this as the table too is dynamically generated.

Thanks in advance! n sorry for the long description given ;)
 
Sheriff
Posts: 67618
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, the target element is available in the Event instance. Bear in mind that IE uses a proprietary event model so you have to special-case it (unless you are using a library such as jQuery).
 
Sailesh Ganeshan
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi BB,
thanks for the reply, but i'm still in need of a solution.. , as i'm unable to use target element here..
the problem is, i use a dynamically generated table, which is not recognised during runtime.
reply
    Bookmark Topic Watch Topic
  • New Topic