Thanks - I will check that out.

I managed to work around this problem by saving the old index in a
class-wide variable and then just programmatically setting the list
index back to the old index if the user hit the cancel button.



--- In flexcoders@yahoogroups.com, "mpricope1980" <[EMAIL PROTECTED]>
wrote:
>
> Hi,
> 
> I don't know if this solve your problem but I've posted something here
>
(http://miti.pricope.com/2008/07/09/datagrid-canceling-a-grid-change-event-using-an-alert-popup/)
> regarding this.
> 
> Miti
> 
> --- In flexcoders@yahoogroups.com, "djohnson29" <djohnson29@> wrote:
> >
> > I have a list of items and a corresponding form to edit values based
> > on what the user has selected.
> > 
> > If the user selects another by clicking the grid, I want to provide an
> > Alert popup if they have not saved their changes.  If the user clicks
> > OK, then the selection takes place as normal, but if they click
> > cancel, I want to cancel the change event and have the editor stay on
> > the selected item.
> > 
> > I can get the event to cancel by declaring an event handler for
> > MouseDown in the creationComplete event, and then having the following
> > lines in the MouseDown handler:
> > 
> > event.stopImmediatePropagation();
> > event.stopPropagation();
> > event.preventDefault();
> > 
> > The problem is that I can only successfully cancel the event
> > propogation from within this method.
> > 
> > If I want to have an alert box with an OK and Cancel button, how do I
> > achieve this?
> > 
> > I have tried calling an Alert handler and using a class event variable
> > to store the event that is received by the MouseDown handler, but
> > if I try to cancel the event from within the Alert handler, nothing
> > happens - I think it is too late at that point.
> > 
> > Can someone provide me with an example of how to cancel event
> > propogation on a grid click or other similar event based on the user's
> > selection from an Alert prompt?
> > 
> > Thanks!
> >
>


Reply via email to