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.
Shruti
Points:0
Posts:0

5/31/2010 5:59:11 AM

Title: Dynamically add HBox container in the particular selected row in the datagrid.


Hi,
With item renderer i have already added checkboxes and labels in the datagrid rows which appears on all the rows. Now I want to add custom components say an HBox on the selected datagrid row in front of the already present label. Could anybody please suggest how to achieve this.



1
Davis
Points: 740
Posts:0
5/31/2010 7:36:00 AM



I think you should create the required control initially in the renderer and make it invisible. It's visibility should be made false using the dataprovider value, On selection update the dataprovider with value to true where the item is selected and refresh the datagrid after that. This will make the control in that particular row visible.

2
Shruti
Points: 20
Posts:0
5/31/2010 11:38:33 AM



but i want to add these controls in any number...in some row they can be one in other they can 4.. so how can i achieve this

3
bob_senior
Points: 1300
Posts:0
6/1/2010 5:42:42 AM



use the below code to add a component dynamically to any row on click of that row
place the below code in your datagrid renderer

//call this function on your initialize event of ItemRenderer
private function init():void{
	this.addEventListener(MouseEvent.CLICK,addComponent);	
}
private function addComponent(evt:Event):void{
	//adding button component
	var btn:Button= new Button();
	this.addElement(btn)
}

4
Shuti
Points: 0
Posts:0
6/1/2010 6:18:41 AM



Hi, thanks alot for your reply bob_senior, i wanted to add child in row on selection of checkboxes outside the renderer. So could you tell me how that i can achieve. How to Set data in the renderer based on the checkboxes selected outside its renderer.

Thanks again!


Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 1+8 



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