flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Harui <aha...@adobe.com>
Subject Re: Spark Datagrid editor session ending
Date Wed, 28 Nov 2012 17:42:29 GMT

On 11/28/12 8:58 AM, "João Fernandes" <joaopedromartinsfernandes@gmail.com>

> Carol but that's the point, with mx:datagrid you can prevent any save()
> using an event listener and without extending the default itemEditor by
> listening to the session_edit_end and calling preventDefault on the event
> dispatched. With spark Datagrid it's not possible. It doesn't make sense
> for each validation I would have to create a new item editor just for
> overriding the save method to implement my business logic.
I argued for an event back in the day but lost.  You shouldn't have to
customize an item editor to deal with the lifecycle of editing.  Events are
easier to hook up to, even if it is a bit less object-oriented.

Now, I see two options:  One is to modify DG to dispatch such an event.
Another is to provide an alternate item editor that dispatches the event
from the DG in its save() method.

In the new framework I am rewriting, I would argue for the second option.
The DG should not waste time dispatching events just-in-case.  You can turn
on that capability by choosing a new default renderer.

But for the legacy code base, we would probably choose option 1.

> On 28 November 2012 16:54, Carol Frampton <cframpto@adobe.com> wrote:
>>  think you override IGridItemEditor save() to do what you want.
>> Carol

Alex Harui
Flex SDK Team
Adobe Systems, Inc.

View raw message