You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@royale.apache.org by Nicolas Aguttes <ni...@gmail.com> on 2020/06/09 08:36:19 UTC

Datagrid and Item_click

Hello all,

I have a datagrid (jewel) and I saw that there is a "change" event which is
fired when a line is selected, but is there a way to handle an itemClick
event?

Thanks
Nicolas

Re: Datagrid and Item_click

Posted by Carlos Rovira <ca...@apache.org>.
Hi Nicolas,

El mié., 10 jun. 2020 a las 7:49, Nicolas Aguttes (<
nicolas.aguttes@gmail.com>) escribió:

> Thanks for your answer, you meant that the listener of the itemclick
> should be put at the column level of my data grid?
>

No, the code is to be set in your custom itemrenderer. You can
additionally make the event bubbles to the class or mxml file where you
declared your DG and add an event handler to do something there. It's up to
you where to manage.


> What I want to achieve is when I click on a line it displays additional
> information ad when I click again on the same line it hides them
>

You can do using a click event too in your itemrenderer mxml root tag

click="doSomething()"

HTH

Carlos


>
> --
> Carlos Rovira
> http://about.me/carlosrovira
>
>
>
>

Re: Datagrid and Item_click

Posted by Nicolas Aguttes <ni...@gmail.com>.
Hello Carlos,

Thanks for your answer, you meant that the listener of the itemclick should
be put at the column level of my data grid?
What I want to achieve is when I click on a line it displays additional
information ad when I click again on the same line it hides them

Nicolas

Le mar. 9 juin 2020 à 11:42, Carlos Rovira <ca...@apache.org> a
écrit :

> Hi Nicolas,
>
> itemClicked is dispatched in the renderer of each column list that are
> parts of the DataGrid, but is not exposed to the column or the datagrid.
>
> In order to understand what's your need about that low level event can you
> elaborate?
>
> In the column list renderer you can listen for that event like this:
>
> override public function addedToParent():void
> {
> addEventListener("itemClicked", itemClickedEventHandler);
> super.addedToParent();
> }
>
> private function itemClickedEventHandler(event:Object):void
> {
> trace("itemClickedEventHandler");
> }
>
> you could redispatch a new custom event, and event make it bubble so you
> can manage at datagrid use level.
>
> HTH
>
> Carlos
>
>
>
>
> El mar., 9 jun. 2020 a las 10:36, Nicolas Aguttes (<
> nicolas.aguttes@gmail.com>) escribió:
>
>> Hello all,
>>
>> I have a datagrid (jewel) and I saw that there is a "change" event which
>> is fired when a line is selected, but is there a way to handle an itemClick
>> event?
>>
>> Thanks
>> Nicolas
>>
>
>
> --
> Carlos Rovira
> http://about.me/carlosrovira
>
>

Re: Datagrid and Item_click

Posted by Carlos Rovira <ca...@apache.org>.
Hi Nicolas,

itemClicked is dispatched in the renderer of each column list that are
parts of the DataGrid, but is not exposed to the column or the datagrid.

In order to understand what's your need about that low level event can you
elaborate?

In the column list renderer you can listen for that event like this:

override public function addedToParent():void
{
addEventListener("itemClicked", itemClickedEventHandler);
super.addedToParent();
}

private function itemClickedEventHandler(event:Object):void
{
trace("itemClickedEventHandler");
}

you could redispatch a new custom event, and event make it bubble so you
can manage at datagrid use level.

HTH

Carlos




El mar., 9 jun. 2020 a las 10:36, Nicolas Aguttes (<
nicolas.aguttes@gmail.com>) escribió:

> Hello all,
>
> I have a datagrid (jewel) and I saw that there is a "change" event which
> is fired when a line is selected, but is there a way to handle an itemClick
> event?
>
> Thanks
> Nicolas
>


-- 
Carlos Rovira
http://about.me/carlosrovira