header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
Senling
Points:0
Posts:0
Answered

8/4/2010 5:55:35 AM

Title: Get parent component of the itemrenderer


Hi
I'm reusing the custom itemrenderer component.



<mx:List id="todolist" width="100%" height="100%" dataProvider="{todoColl}"  labelField="todo" itemRenderer="Customchecklist"/> 

<mx:List id="donelist" width="100%" height="100%" dataProvider="{todoColl}"  labelField="todo" itemRenderer="Customchecklist"/> 

I'm trying to get the id of the list inside the itemrenderer, which list the itemrenderer is rendered . Thanks in Advance. Senling



1
Shawn
Points: 680
Posts:0
Accepted Answer
8/4/2010 6:53:53 AM



In the itemRenderer use "parent.parent.name" this should work for a tileList you can go up and down by adding or removing more parents to reach the exact parent .

you can trace this on the initialize event of the renderer


protected function renderer_initializeHandler(event:FlexEvent):void
{
// to see all levels of containers trace this
trace(this)	
//the list should be around 2 leves back
trace(parent.parent.name)
}


2
Senling
Points: 0
Posts:0
8/4/2010 6:59:45 AM



Yes it worked perfectly.

I tried all the possibilities of parent.parent, owner.document etc..,

parent.parent.name worked perfectly, this is what i need..

Many thanks
Senling.

3
Shawn
Points: 680
Posts:0
8/4/2010 7:23:18 AM



that's great welcome :)


Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 4+5 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions