Hi,

> Is there a way to produce a grid whereby clicking the anywhere on the
> grid will result in an action that I would like to perform
> specifically to that point?
> ...
> something that can behave like this (maybe a white button)
> ...

Yes, that's not a problem, you can use divs or spans, since you get
"click" events on all elements, not just buttons.

Here's a quick example:  http://pastie.org/318600

That uses:

* The Prototype dom:loaded event[1] to trigger page initialization
* Element#observe[2] to watch the div containing the calendar for
clicks on it or its descendants
* Event#findElement[3] to find the element that was actually clicked.
Event#findElement accepts a CSS selector and finds the first matching
element starting from the element that was actually clicked and then
looking up through its ancestors.  Very handy for event delegation,
which is what we're doing here to avoid having to watch each day
individually.
* Event#pointerX[4] and Event#pointerY to find out where the mouse was
clicked

[1] http://prototypejs.org/api/document/observe
[2] http://prototypejs.org/api/element/observe
[3] http://prototypejs.org/api/event/findElement
[4] http://prototypejs.org/api/event/pointerX

HTH,
--
T.J. Crowder
tj / crowder software / com

On Nov 19, 6:33 am, disappearedng <[EMAIL PROTECTED]> wrote:
> Hi everyone
> Is there a way to produce a grid whereby clicking the anywhere on the
> grid will result in an action that I would like to perform
> specifically to that point? I know I sound confusing but I am actually
> looking for something similar to google's calendar. Is there something
> out there that is similar - when you click on a particular box, a
> dialog pops up and ask you what the event details are etc etc.
>
> Is there a way to make an entire area populated with a unit of
> something that can behave like this (maybe a white button) and then
> generating tons of these to cover an entire area?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to