Retrieve current item on a DataGroup

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

Retrieve current item on a DataGroup

Jairo França (TGI)
I have a question that seems easy, but i can't solve.
I have a DataGroup with a custom ItemRenderer.
How can I retrieve the current item that was selected with a double
click (something like a SelectedItem on a DataGrid)?
Can I retrieve the "itemRenderer" instance of the element?



Thansk

My code is:




     <s:Group height="100%" width="100%">
             <s:Scroller height="100%" width="100%" id="scr">
                 <s:DataGroup id="dg" height="100%" width="100%"
itemRenderer="myItemRenderer"
                              dataProvider="{_data}"
doubleClickEnabled="true" doubleClick="dg_doubleClickHandler(event)">
                     <s:layout>
                         <s:TileLayout/>
                     </s:layout>
                 </s:DataGroup>
             </s:Scroller>
         </s:Group>
Reply | Threaded
Open this post in threaded view
|

Re: Retrieve current item on a DataGroup

Alex Harui
If you need selection, why not use List?

From: Jairo França <[hidden email]<mailto:[hidden email]>>
Reply-To: "[hidden email]<mailto:[hidden email]>" <[hidden email]<mailto:[hidden email]>>
Date: Tuesday, November 5, 2013 9:27 AM
To: "[hidden email]<mailto:[hidden email]>" <[hidden email]<mailto:[hidden email]>>
Subject: [flexcoders] Retrieve current item on a DataGroup



I have a question that seems easy, but i can't solve.
I have a DataGroup with a custom ItemRenderer.
How can I retrieve the current item that was selected with a double
click (something like a SelectedItem on a DataGrid)?
Can I retrieve the "itemRenderer" instance of the element?

Thansk

My code is:

<s:Group height="100%" width="100%">
<s:Scroller height="100%" width="100%" id="scr">
<s:DataGroup id="dg" height="100%" width="100%"
itemRenderer="myItemRenderer"
dataProvider="{_data}"
doubleClickEnabled="true" doubleClick="dg_doubleClickHandler(event)">
<s:layout>
<s:TileLayout/>
</s:layout>
</s:DataGroup>
</s:Scroller>
</s:Group>


Reply | Threaded
Open this post in threaded view
|

Re: Retrieve current item on a DataGroup

Jairo França (TGI)
As a previous mail already said: "Thanks Alex!".


Em 07/11/2013 05:11, Alex Harui escreveu:

> If you need selection, why not use List?
>
> From: Jairo França <[hidden email] <mailto:[hidden email]>>
> Reply-To: "[hidden email]
> <mailto:[hidden email]>" <[hidden email]
> <mailto:[hidden email]>>
> Date: Tuesday, November 5, 2013 9:27 AM
> To: "[hidden email] <mailto:[hidden email]>"
> <[hidden email] <mailto:[hidden email]>>
> Subject: [flexcoders] Retrieve current item on a DataGroup
>
> I have a question that seems easy, but i can't solve.
> I have a DataGroup with a custom ItemRenderer.
> How can I retrieve the current item that was selected with a double
> click (something like a SelectedItem on a DataGrid)?
> Can I retrieve the "itemRenderer" instance of the element?
>
> Thansk
>
> My code is:
>
> <s:Group height="100%" width="100%">
> <s:Scroller height="100%" width="100%" id="scr">
> <s:DataGroup id="dg" height="100%" width="100%"
> itemRenderer="myItemRenderer"
> dataProvider="{_data}"
> doubleClickEnabled="true" doubleClick="dg_doubleClickHandler(event)">
> <s:layout>
> <s:TileLayout/>
> </s:layout>
> </s:DataGroup>
> </s:Scroller>
> </s:Group>
>
>