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

5/31/2010 7:41:50 PM

Title: datagrid CheckBox Item Renderer


Hi,
I have a datagrid inside check box itemrenderer. my datagrid column like

Isselected Title

CheckBox1 RAMA
CheckBox2 Krishna
CheckBox3 Venkat
CheckBox4 xxxxxx


Creating project:
I am selecting check boxes 1 and 4 and send to the database.


My question is,
Updating project:

Whenever i am updating the project, Out of four checkboxes only i was Selected two check boxes only and i am selecting one more checkbox. How to show checkboxes selected true from the data coming from the database?

How to checking the conditon? Please any one having the code, please send me ? Its urgent.

Thanks
Rama







1
Davis
Points: 440
Posts:0
5/31/2010 9:58:01 PM



To maintain the state of your checkbox in Datagrid on refresh you need to provide the dataProvider to Datagrid from database. On load of you application you should call the server page which will return you the xml from database and set that xml as dataProvider for your datagrid.

2
bob_senior
Points: 880
Posts:0
5/31/2010 11:43:17 PM



you need to receive the xml from server and set the status of checkboxes initially when the application is started. Check the following example to populate a datagrid using the xml as dataprovider and setting the checkbox status from xml nodes.


<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" horizontalAlign="center" verticalAlign="middle">
		<mx:XMLList id="myXML" xmlns="">
			<node isChecked="true" name="chk1" Colum1="abc1"/>
			<node isChecked="false" name="chk2" Colum1="abc2"/>
			<node isChecked="true" name="chk3" Colum1="abc3"/>
		</mx:XMLList>
	<mx:DataGrid id="dataGrid" dataProvider="{myXML}" editable="true">
		<mx:columns>
			<mx:DataGridColumn  width="25" headerText=" " editable="false">
				<mx:itemRenderer>
					<mx:Component>
						<mx:CheckBox selected="{(data.@isChecked == 'true')?true:false}"/>
					</mx:Component>
				</mx:itemRenderer>
			</mx:DataGridColumn>
			<mx:DataGridColumn dataField="@name" headerText="Name"/>
			<mx:DataGridColumn dataField="@Colum1" headerText="Colum"/>
		</mx:columns>
	</mx:DataGrid>
</mx:Application>



Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 1+2 



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