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/26/2010 11:18:34 AM

Title: datagrid (urgent)


Hi,

I have a datagrid, I get the data from the database. In my datagrid have the columns like

MyDataGrid

Title , Status

Rama 1
krishna 0
Venki 1
yyyy 0


This data i will get the data from the database.


My Question is i want to display the data instead of Status like 0 - ---> InActive
1 -------> Active


I want the MyDataGrid result

Title , Status

Rama Active
krishna Inactive
Venki Active
yyyy Inactive


Please help me,

Thanks






1
Inder
Points: 2620
Posts:0
5/26/2010 11:55:03 AM



use this actionscript 3.0 function to update the status field of DataGrid in flex depending upon its value 0 or 1

//use this method to update Status field , "dataGrid" is the datagrid ID, update with your
protected function updateStatus():void
{
	dataGrid.setRowBackgroundColor(3,0xffeeee);
	for(var i:int;i<dataGrid.dataProvider.length;i++){
		if(dataGrid.dataProvider[i].Status==0){
			dataGrid.dataProvider[i].Status ="InActive";
		}else{
			dataGrid.dataProvider[i].Status ="Active";
		}
	}
	dataGrid.dataProvider.refresh();
}


2
Ramakrishna
Points: 0
Posts:0
5/26/2010 6:50:59 PM



Hi Inder,

Where Can i write the updateStatus method?



3
Inder
Points: 2620
Posts:0
5/26/2010 10:39:51 PM



you can write that after you populate your datagrid, I mean when you set its dataprovider.


Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 5+7 



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