• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 208
  • Last Modified:

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
0
royjayd
Asked:
royjayd
  • 2
  • 2
1 Solution
 
dgofmanCommented:
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

0
 
royjaydAuthor Commented:
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


0
 
dgofmanCommented:
listItems[i][0].data.children[0].children[0].children[0].actualDays= days;??

How do you know listItems[i][0]. is not null

and listItems[i][0].data hase children

You don't want to introduce null errors in your application.

Open in new window


Is not good changing item elements without updating a dataProvider

0
 
royjaydAuthor Commented:
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now