Link to home
Start Free TrialLog in
Avatar of Jay Roy
Jay RoyFlag for United States of America

asked on

set value to children

hi guys

i have this code
if(pair.length == 2){
var status:String = pair[0];   //will show CEO
var [b]days[/b]:Object = pair[1];  //will show a number
}

Open in new window

                                          
now i want to set the days to listItem's children like this
listItems[i][0].data.children[0].children[0].children[0].[b]actualDays[/b]= [b]days[/b];

Open in new window

but actualDaysis not getting updated. Will the above line work?

thanks
Avatar of dgofman
dgofman
Flag of United States of America image

The same problme you have to parse your data and split to the mutiple columns before you will pass to dataProvider

Example:

var array:Array = [{CEO:111}, {ENG:222}, {SALES:333}];

convert to

var array:Array = [{status:CEO, days:111}, {status:ENG, days:222}, {status:SALES, days:333}];

Now in your DataGrid you can create two columns status and days and data will come without any problems

Avatar of Jay Roy

ASKER

but why do i need Array
I just need to set the days  value from   var days:Object = pair[1];   to the actualDays  property
like this
listItems[i][0].data.children[0].children[0].children[0].actualDays= days; 

Open in new window


ASKER CERTIFIED SOLUTION
Avatar of dgofman
dgofman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial