set value to children

Posted on 2011-10-20
Last Modified: 2012-05-12
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?

Question by:royjayd
    LVL 29

    Expert Comment

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


    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


    Author Comment

    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

    LVL 29

    Accepted Solution

    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


    Author Closing Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
    This post first appeared at Oracleinaction  ( Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    This video discusses moving either the default database or any database to a new volume.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now