You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@royale.apache.org by gbarbosa <gb...@gmail.com> on 2021/04/01 22:25:49 UTC

mx:DataGrid "change" event behavior

Hi Royale Team,

When I click on a row in my dataGrid the "change" event is dispatched. My
question is why is this a ListEvent and furthermore why doesn't it have the
properties of itemRenderer, colIndex, rowIndex and reason set?

What is the workaround to get these properties? 

From the Flex side ListBase would convert the "click" event into an
"itemClick" event and set these properties and dispatch the event, this must
have been a design choice by Royale to break this functionality.

What is the royale way to interact with the item in the mx:DataGrid at the
top level?

Thank you for your time,
Gabriel Barbosa



--
Sent from: http://apache-royale-development.20373.n8.nabble.com/

Re: mx:DataGrid "change" event behavior

Posted by GAbe Barbosa <gb...@gmail.com>.
Thanks for the explanation Edward!

I probably want to eventually eventually port the code to mx:DataGrid
because we use it everywhere in our codebase. I took a look at the source
code and wasn't sure if the event needs to be dispatched on the strand like
in AdvancedDataGrid. I'll have to experiment some more and try to learn the
royale way of doing things before I submit a pull request.

As a workaround I just dispatched my own custom event. Unsustainable
long-term, but will do for now.

Thanks again.

-Gabriel Barbosa

Re: mx:DataGrid "change" event behavior

Posted by Edward Stangler <es...@bradmark.com>.
My bad.  I was looking at AdvancedDataGrid.  AdvancedDataGrid does
generate itemClick, but DataGrid does not.

The code for generating the event is in
AdvancedDataGridSingleSelectionMouseController.selectedHandler().  But 
DataGridSingleSelectionMouseController.selectedHandler() is not fully
implemented.  I don't think it was a design decision;  just nobody
implemented it yet.

It would be fairly easy to port the code from AdvancedDataGrid to
DataGrid.  However, in my experience, the only data grid reasonably (but
not fully) working between MX and Spark is mx:AdvancedDataGrid.  So you
may have other problems later.

Is it feasible for you to move to mx:AdvancedDataGrid?  (columns are
mx:AdvancedDataGridColumn, instead of mx:DataGridColumn)



On 4/2/2021 2:01 PM, GAbe Barbosa wrote:
>  " It does generate a ListEvent.ITEM_CLICK event. "
>
> I haven't been able to generate an "itemClick" event, only a "change"
> event. How were you able to accomplish this? The property itemClick is not
> implemented on the mx:DataGrid side. I explicitly added the eventListener
> for "itemClick" on the mx:DataGrid and never heard anything. It does not
> appear to be ever getting dispatched.
>
> Hopefully I'm doing something wrong and "itemClick" is getting dispatched
> because all my code that relies on listening for an "itemClick" event will
> break if this is not the case.
>
> I'm asking if this was a design choice by Royale and how should I go about
> getting the properties of colIndex, rowIndex and ItemRenderer.
> On Thu, Apr 1, 2021 at 3:33 PM Edward Stangler <es...@bradmark.com>
> wrote:
>
>> It does generate a ListEvent.ITEM_CLICK event.
>>
>>
>>
>> On 4/1/2021 5:27 PM, gbarbosa wrote:
>>> Hi Royale Team,
>>>
>>> When I click on a row in my dataGrid the "change" event is dispatched. My
>>> question is why is this a ListEvent and furthermore why doesn't it have
>> the
>>> properties of itemRenderer, colIndex, rowIndex and reason set?
>>>
>>> What is the workaround to get these properties?
>>>
>>> From the Flex side ListBase would convert the "click" event into an
>>> "itemClick" event and set these properties and dispatch the event, this
>> must
>>> have been a design choice by Royale to break this functionality.
>>>
>>> What is the royale way to interact with the item in the mx:DataGrid at
>> the
>>> top level?
>>>
>>> Thank you for your time,
>>> Gabriel Barbosa
>>>
>>>
>>>
>>> --
>>> Sent from: http://apache-royale-development.20373.n8.nabble.com/
>>>
>>


Re: mx:DataGrid "change" event behavior

Posted by GAbe Barbosa <gb...@gmail.com>.
 " It does generate a ListEvent.ITEM_CLICK event. "

I haven't been able to generate an "itemClick" event, only a "change"
event. How were you able to accomplish this? The property itemClick is not
implemented on the mx:DataGrid side. I explicitly added the eventListener
for "itemClick" on the mx:DataGrid and never heard anything. It does not
appear to be ever getting dispatched.

Hopefully I'm doing something wrong and "itemClick" is getting dispatched
because all my code that relies on listening for an "itemClick" event will
break if this is not the case.

I'm asking if this was a design choice by Royale and how should I go about
getting the properties of colIndex, rowIndex and ItemRenderer.
On Thu, Apr 1, 2021 at 3:33 PM Edward Stangler <es...@bradmark.com>
wrote:

>
> It does generate a ListEvent.ITEM_CLICK event.
>
>
>
> On 4/1/2021 5:27 PM, gbarbosa wrote:
> > Hi Royale Team,
> >
> > When I click on a row in my dataGrid the "change" event is dispatched. My
> > question is why is this a ListEvent and furthermore why doesn't it have
> the
> > properties of itemRenderer, colIndex, rowIndex and reason set?
> >
> > What is the workaround to get these properties?
> >
> > From the Flex side ListBase would convert the "click" event into an
> > "itemClick" event and set these properties and dispatch the event, this
> must
> > have been a design choice by Royale to break this functionality.
> >
> > What is the royale way to interact with the item in the mx:DataGrid at
> the
> > top level?
> >
> > Thank you for your time,
> > Gabriel Barbosa
> >
> >
> >
> > --
> > Sent from: http://apache-royale-development.20373.n8.nabble.com/
> >
>
>

Re: mx:DataGrid "change" event behavior

Posted by Edward Stangler <es...@bradmark.com>.
It does generate a ListEvent.ITEM_CLICK event.



On 4/1/2021 5:27 PM, gbarbosa wrote:
> Hi Royale Team,
>
> When I click on a row in my dataGrid the "change" event is dispatched. My
> question is why is this a ListEvent and furthermore why doesn't it have the
> properties of itemRenderer, colIndex, rowIndex and reason set?
>
> What is the workaround to get these properties? 
>
> From the Flex side ListBase would convert the "click" event into an
> "itemClick" event and set these properties and dispatch the event, this must
> have been a design choice by Royale to break this functionality.
>
> What is the royale way to interact with the item in the mx:DataGrid at the
> top level?
>
> Thank you for your time,
> Gabriel Barbosa
>
>
>
> --
> Sent from: http://apache-royale-development.20373.n8.nabble.com/
>