tags:

views:

17

answers:

1

I have two separate advancedDataGrid instances (let's call them A and B). What I'd like to do: when clicking on grid A I'd like

  1. for grid A to handle the click normally (i.e. default advancedDataGrid behavior)
  2. for grid B to receive a click event a certain location and handle such event using advancedDataGrid default behavior (i.e. without having to write a handler for such click).

Is this possible?

I've managed to dispatchEvent a MouseEvent.CLICK to grid B and to handle such event by creating an event listener, but really I'd like for grid B to handle the event on its own (i.e. without having to re-rewrite a handler), and that doesn't seem to be the case. Is MouseEvent.CLICK even the right event?

any help, pointers, advice would be immensely appreciated.

thank you!

A: 

There is no way to execute code after an event is dispatched without using an event listener.

I'm unclear exactly what you're trying to do, but there is no reason why you can't dispatch an event on an object that is not it's own. Instead of doing:

myContainerWithAAndB.dispatchEvent(MouseEvent.CLICK);

You can do this:

gridB.dispatchEvent(MouseEvent.CLICK);

And if there is a default handler in the gridB class to handle such an event, that handler should fire; just as if gridB's own code had dispatched the event.

www.Flextras.com
thanks, that makes sense. Somehow the default handler doesn't seem to do work as I would normally expect - i.e. select a row when clicking on one. My guess is that perhaps the event that I should dispatch is not a MouseEvent.CLICK - not sure. Anyway, thanks for the help, what you wrote makes sense.
fred august