Datagrid and Item_click

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Datagrid and Item_click

tranquiliste
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
Nicolas
Reply | Threaded
Open this post in threaded view
|

Re: Datagrid and Item_click

Carlos Rovira-2
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 (<[hidden email]>) 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


--
Reply | Threaded
Open this post in threaded view
|

Re: Datagrid and Item_click

tranquiliste
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 <[hidden email]> 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 (<[hidden email]>) 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


--
Nicolas
Reply | Threaded
Open this post in threaded view
|

Re: Datagrid and Item_click

Carlos Rovira-2
Hi Nicolas,

El mié., 10 jun. 2020 a las 7:49, Nicolas Aguttes (<[hidden email]>) 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