Complex VO as AdvancedDataGrid dataProvider

I would like to access fields in a complex VO from my AdvancedDataGrid.
By 'complex' I mean - that my AdvancedDataGrid dataProvider point to VO of type 'A' which containes (besides properties) VO of type 'B'.
I would like that part of my colums will point to B's fields (e.g.<mx:AdvancedDataGridColumn dataField="B.Myfield"/>
Is that possible?

After digging the web, I've found several user solutions for this issue.
It seems that ADOBE not found this issue to be urgent enough, thus not support it in standard manner
For those of you who just  encounter this issue, here are few solutions I've found:
- http://natescodevault.com/?p=61
- http://active.tutsplus.com/tutorials/flex/working-with-the-flex-datagrid-and-nes  ted-data-structures/
- http://www.switchonthecode.com/tutorials/nested-data-in-flex-datagrid-by-extendi  ng-datagridcolumn
(NOTE: for the last one, I found a  post which describes how to support edit-mode too: http://kennethteo.com/2008/12/19/editing-nested-data-for-flex-datagrid/)
Cheers,  Haim

Similar Messages

  • Resetting HierarchicalData AdvancedDataGrid dataProvider causes children to be invisible

    I have an AdvancedDataGrid (ADG) setup as a child of a
    ViewStack. The dataProvider is a HierarchicalData collection that
    is set dynamically based on the report that the user selected from
    a list.
    The first time I setup the HierarchicalData, all of the data
    is displayed correctly. However, when I reset the collection (when
    the user selects the same report at a later time), although all of
    the data is there, not all of it is displayed in the ADG. There is
    a node that is able to be opened, and when I open it, I can verify
    that the data is there. But, the data under that node is not
    displayed.
    Any thoughts on what is causing this, or what workarounds I
    can put in place?
    Thanks.

    can you post your source project? you must be addding the node the array collec
    tion more then once??? maybe. I wouldnt be able to tell unless you posted your project and we can take a look at it.
    Miguel

  • Strange behaviour with advancedDatagrid.dataprovider.showRoot = false

    I encounter a minor problem while implementing this idea from
    Sreenivas to get a summary row with "root" nodes in an
    AdvancedDataGrid.
    http://flexpearls.blogspot.com/2007/11/generating-summary-for-flat-data-using.html
    My problem is that the nodes for the two first depth don't
    have a "tab character" before their name.
    Take a look at these screenshots to understand what i mean:
    - here showing root node
    http://img411.imageshack.us/img411/6610/sanstitre2gz0.png
    - here hiding root node
    http://img143.imageshack.us/img143/3535/sanstitrese8.png
    As you can see "interne" need a little shift to be placed
    under "interne"
    same for "forfait" and "AT" under "facturable"
    and so on...
    Thanks in advance for the tip.
    Laurent Pinson

    have you found the solution? I'm stack with the same problem.

  • How to update one row in AdvancedDataGrid

    My App have a AdvancedDataGrid and it has so much rows. Some
    data rows for AdvancedDataGrid has changed and i don't want to
    update all rows ... But i don't know how to update one row for my
    AdvancedDataGrid
    Some body help me ...
    Thanks so muchs !

    thanks ntsii.
    my problem is:
    [Bindable]
    var dp:ArrayColection = new ArrayColection({...});
    <mx:AdvancedDataGrid dataProvider="{dp}">
    <mx:groupedColumns>
    </mx:groupedColumns>
    </mx:AdvancedDataGrid>
    //==================================
    in my dp have more rows and some time one of them is changed
    then i guess the AdvancedDataGrid must build all rows when
    it's dataProvider (dp) have changed.
    And i don't want to that...
    But i am not sure the AdvancedDataGrid buld all rows from
    begin to end ... i don't know.. !

  • Flash Islands, AdvancedDataGrid, problem with grouping

    Hello,
    I am trying to show a table from SAP into an AdvancedDataGrid:
         <mx:AdvancedDataGrid dataProvider="" width="100%" rowCount="13" >
              <mx:columns>
                 <mx:AdvancedDataGridColumn dataField=""
                  headerText="Monat" />
    This works very well. Now I am trying to build a tree with grouping in the same grid:
    <mx:AdvancedDataGrid width="100%"      rowCount="13">
         <mx:dataProvider>
              <mx:GroupingCollection source=""/>
              <mx:Grouping>
                   <mx:GroupingField name=""/>
                   <mx:GroupingField name=""/>
              </mx:Grouping>
         </mx:dataProvider>
         <mx:columns>
              <mx:AdvancedDataGridColumn dataField="" headerText="Monat"/>
    Unfortunatly I get an empty table. Does anybody know my mistake?
    regards
    stefan

    Thx for reply. I understand what you mean. I was a littlebit to hasty. I should have waited until finishing everything. Point 3.c in the chapter mentioned above states it clearly.
    Sorry 4 that.

  • Help moving to Flex 3 using AdvancedDataGrid

    I am just moving over to Flex 3 and want to use the
    AdvancedDataGrid and I can't seem to get it to read the lastResult
    of an HTTPService.
    if I use dataProvider="{studXML.lastResult.student}" I get
    stuff in the grid but it's not hierarchical (no folder opening to
    see children nodes)
    if I use dataProvider="{new
    HierarchicalData(studXML.lastResult.student)}" I get no data in the
    grid
    I tried messing with the resultFormat of the HTTPService but
    nothing seems to work (it seems it has to be e4x just to get some
    data displayed)
    Am I missing some new behavior with the AdvancedDataGrid?
    (code and data below)
    I appreciate any clues. Thanks.
    be well,
    Hoyt
    My Code:
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" creationComplete="studXML.send();">
    <mx:HTTPService id="studXML" resultFormat="e4x" url="
    http://localhost/~hoytng/Workspace/studentDB/xml/student.xml"/>
    <mx:AdvancedDataGrid
    dataProvider="{studXML.lastResult.student}" x="10" y="306"
    id="adg1" designViewDataType="tree" width="1004" height="452">
    <mx:columns>
    <mx:AdvancedDataGridColumn headerText="Student Name"
    dataField="@studname"/>
    <mx:AdvancedDataGridColumn headerText="Notes"
    dataField="notes"/>
    <mx:AdvancedDataGridColumn headerText="Curriculum"
    dataField="@currid"/>
    <mx:AdvancedDataGridColumn headerText="Class Name"
    dataField="@klassname"/>
    <mx:AdvancedDataGridColumn headerText="Date"
    dataField="@date"/>
    </mx:columns>
    </mx:AdvancedDataGrid>
    </mx:Application>
    My Data:
    <rwc>
    <student studname="fred flintstone">
    <notes><![CDATA[Can't feed his
    brontosaurus]]></notes>
    <curriculum currid="1" currname="curricula B">
    <class klassname="klass A" sched="no" take="no" date=""
    inst=""/>
    <class klassname="klass B" sched="no" take="no" date=""
    inst=""/>
    <class klassname="klass C" sched="no" take="no" date=""
    inst=""/>
    <class klassname="klass D" sched="no" take="no" date=""
    inst=""/>
    </curriculum>
    </student>
    <student studname="barney rubble">
    <notes><![CDATA[This is about
    dinosaurs]]></notes>
    <curriculum currid="2" currname="curricula A">
    <class klassname="klass A" sched="yes" take="no"
    date="01252008" inst="jim jestson"/>
    <class klassname="klass B" sched="yes" take="yes"
    date="01262008" inst="bob hope"/>
    <class klassname="klass D" sched="no" take="no"
    date="02142008" inst="mr hooper"/>
    <class klassname="klass F" sched="yes" take="no"
    date="02162008" inst="mr rogers"/>
    </curriculum>
    </student>
    </rwc>

    You need to set the childrenField property of
    HierarchicalData to point to curriculum (assuming classes are to be
    displayed as children).
    Because by default for XML, all the child nodes would get
    treated as child nodes.

  • AdvancedDataGrid - create Array (cfquery) with children for hierarchical data set

    I'm trying to create an AdvancedDataGrid with a hierarchical
    data set as shown below. The problem that I am having is how to
    call the data from a ColdFusion remote call and not an
    ArrayCollection inside of the Flex app (as below). I'm guessing
    that the problem is with the CFC that I've created which builds an
    array with children. I assume that the structure of the children is
    the issue. Any thoughts?
    Flex App without Remoting:
    http://livedocs.adobe.com/labs/flex3/html/help.html?content=advdatagrid_10.html
    <?xml version="1.0"?>
    <!-- dpcontrols/adg/GroupADGChartRenderer.mxml -->
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml">
    <mx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    [Bindable]
    private var dpHierarchy:ArrayCollection= new
    ArrayCollection([
    {name:"Barbara Jennings", region: "Arizona", total:70,
    children:[
    {detail:[{amount:5}]}]},
    {name:"Dana Binn", region: "Arizona", total:130, children:[
    {detail:[{amount:15}]}]},
    {name:"Joe Smith", region: "California", total:229,
    children:[
    {detail:[{amount:26}]}]},
    {name:"Alice Treu", region: "California", total:230,
    children:[
    {detail:[{amount:159}]}
    ]]>
    </mx:Script>
    <mx:AdvancedDataGrid id="myADG"
    width="100%" height="100%"
    variableRowHeight="true">
    <mx:dataProvider>
    <mx:HierarchicalData source="{dpHierarchy}"/>
    </mx:dataProvider>
    <mx:columns>
    <mx:AdvancedDataGridColumn dataField="name"
    headerText="Name"/>
    <mx:AdvancedDataGridColumn dataField="total"
    headerText="Total"/>
    </mx:columns>
    <mx:rendererProviders>
    <mx:AdvancedDataGridRendererProvider
    dataField="detail"
    renderer="myComponents.ChartRenderer"
    columnIndex="0"
    columnSpan="0"/>
    </mx:rendererProviders>
    </mx:AdvancedDataGrid>
    </mx:Application>
    CFC - where I am trying to create an Array to send back to
    the Flex App
    <cfset aPackages = ArrayNew(1)>
    <cfset aDetails = ArrayNew(1)>
    <cfloop query="getPackages">
    <cfset i = getPackages.CurrentRow>
    <cfset aPackages
    = StructNew()>
    <cfset aPackages['name'] = name >
    <cfset aPackages
    ['region'] = region >
    <cfset aPackages['total'] = total >
    <cfset aDetails
    = StructNew()>
    <cfset aDetails['amount'] = amount >
    <cfset aPackages
    ['children'] = aDetails >
    </cfloop>
    <cfreturn aPackages>

    I had similar problems attempting to create an Array of
    Arrays in a CFC, so I created two differents scripts - one in CF
    and one in Flex - to build Hierarchical Data from a query result.
    The script in CF builds an Hierarchical XML document which is then
    easily accepted as HIerarchical Data in Flex. The script in Flex
    loops over the query Object that is returned as an Array
    Collection. It took me so long to create the XML script, and I now
    regret it, since it is not easy to maintain and keep dynamic.
    However, it only took me a short while to build this ActionScript
    logic, which I quite like now (though it is not [
    yet ] dynamic, and currently only handles two levels of
    Hierarchy):
    (this is the main part of my WebService result handler)....
    // Create a new Array Collection to store the Hierarchical
    Data from the WebService Result
    var categories:ArrayCollection = new ArrayCollection();
    // Create an Object variable to store the parent-level
    objects
    var category:Object;
    // Create an Object variable to store the child-level
    objects
    var subCategory:Object;
    // Loop through each Object in the WebService Result
    for each (var object:Object in results)
    // Create a new Array Collection as a copy of the Array
    Collection of Hierarchical Data
    var thisCategory:ArrayCollection = new
    ArrayCollection(categories.toArray());
    // Create a new instance of the Filter Function Class
    var filterFunction:FilterFunction = new FilterFunction();
    // Create Filter on the Array Collection to return only
    those records with the specified Category Name
    thisCategory.filterFunction =
    filterFunction.NameValueFilter("NAMETXT", object["CATNAMETXT"]);
    // Refresh the Array Collection to apply the Filter
    thisCategory.refresh();
    // If the Array Collection has records, the Category Name
    exists, so use the one Object in the Collection to add Children to
    if (thisCategory.length)
    category = thisCategory.getItemAt(0);
    // If the Array Collection has no records, the Category Name
    does not exist, so create a new Object
    else
    // Create a new parent-level Object
    category = new Object();
    // Create and set the Name property of the parent-level
    Object
    category["NAMETXT"] = object["CATNAMETXT"];
    // Create a Children property as a new Array
    category["children"] = new Array();
    // Add the parent-level Object to the Array Collection
    categories.addItem(category);
    // Create a new child-level Object as a copy of the Object
    in the WebService Result
    subCategory = object;
    // Create and set the Name property of the child-level
    Object
    subCategory["NAMETXT"] = object["SUBCATNAMETXT"];
    // Add the child-level Object to the Array of Children on
    the parent-level Object
    category["children"].push(subCategory);
    // Convert the Array Collection to a Hierarchical Data
    Object and use it as the Data Provider for the Advanced Data Grid
    advancedDataGrid.dataProvider = new
    HierarchicalData(categories);

  • Xml Attributes with ADG

    Hi all,
    i'm new to flex.I have a problem regarding XML
    attributes."How to get the XML attribute value from the xml file to
    Flex application using HTTPService".I tried but it is coming only
    one attribute value.
    First i have to get the attribute values from the XML file
    and display in AdvancedDataGrid with tree structure.
    Here i will send my XML file and MXML file...
    Can u see and check my code............plzzz
    XML file................
    <?xml version="1.0" encoding="UTF-8"?>
    <todolist>
    <folder state="" label="Today todo list" isBranch="true"
    >
    <folder cat="Travel" state="High" duedate="3/09/2008"
    isBranch="false" label="book tickets" />
    <folder cat="Social" state="Low" duedate="4/09/2008"
    isBranch="false" label="Meeting at 7pm" />
    <folder state="" isBranch="true" label="Home " >
    <folder cat="Home" state="High" duedate="3/09/2008"
    isBranch="false" label="Pay power bill" />
    <folder cat="Home" state="High" duedate="3/09/2008"
    isBranch="false" label="Pay rent" />
    <folder cat="Home" state="Low" duedate="3/09/2008"
    isBranch="false" label="Call parents" />
    <folder cat="Home" state="Low" duedate="3/09/2008"
    isBranch="false" label="Attend John birthday party" />
    <folder cat="Home" state="Medium" duedate="3/09/2008"
    isBranch="false" label="Special Updates" />
    <folder cat="Home" state="high" isBranch="false"
    label="get Dr. appointment" />
    </folder>
    <folder state="" isBranch="true" label="Office " >
    <folder cat="Off" state="High" isBranch="false"
    label="Meeting at 5pm" />
    <folder cat="Off" state="Low" isBranch="false"
    label="Complete document and send to client" />
    <folder cat="Off" state="Low" isBranch="false"
    label="Interviews and Transcripts" />
    <folder cat="Off" state="High" isBranch="false"
    label="Set Deployment machine" />
    <folder cat="Off" state="High" isBranch="false"
    label="send status reports" />
    </folder>
    </folder>
    </todolist>
    MXML file............
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute"
    initialize="adgService.send()">
    <mx:HTTPService id="adgService" url="adg.xml"/>
    <mx:AdvancedDataGrid
    dataProvider="{adgService.lastResult.todolist.folder}">
    <mx:columns>
    <mx:AdvancedDataGridColumn headerText="Name"
    dataField="label"/>
    <mx:AdvancedDataGridColumn headerText="Age"
    dataField="state"/>
    </mx:columns>
    </mx:AdvancedDataGrid>
    </mx:Application>
    Thnaks & Regards
    edeewan

    "edeewan" <[email protected]> wrote in
    message
    news:[email protected]...
    > Hi all,
    > i'm new to flex.I have a problem regarding XML
    attributes."How to
    > get
    > the XML attribute value from the xml file to Flex
    application using
    > HTTPService".I tried but it is coming only one attribute
    value.
    >
    > First i have to get the attribute values from the XML
    file and display in
    > AdvancedDataGrid with tree structure.
    > Here i will send my XML file and MXML file...
    > Can u see and check my code............plzzz
    >
    > XML file................
    >
    > <?xml version="1.0" encoding="UTF-8"?>
    > <todolist>
    > <folder state="" label="Today todo list"
    isBranch="true" >
    >
    > <folder cat="Travel" state="High" duedate="3/09/2008"
    isBranch="false"
    > label="book tickets" />
    > <folder cat="Social" state="Low" duedate="4/09/2008"
    isBranch="false"
    > label="Meeting at 7pm" />
    >
    > <folder state="" isBranch="true" label="Home " >
    >
    > <folder cat="Home" state="High" duedate="3/09/2008"
    isBranch="false"
    > label="Pay power bill" />
    > <folder cat="Home" state="High" duedate="3/09/2008"
    isBranch="false"
    > label="Pay rent" />
    > <folder cat="Home" state="Low" duedate="3/09/2008"
    isBranch="false"
    > label="Call parents" />
    > <folder cat="Home" state="Low" duedate="3/09/2008"
    isBranch="false"
    > label="Attend John birthday party" />
    > <folder cat="Home" state="Medium" duedate="3/09/2008"
    > isBranch="false"
    > label="Special Updates" />
    > <folder cat="Home" state="high" isBranch="false"
    label="get Dr.
    > appointment" />
    >
    > </folder>
    >
    > <folder state="" isBranch="true" label="Office " >
    >
    > <folder cat="Off" state="High" isBranch="false"
    label="Meeting
    > at
    > 5pm" />
    > <folder cat="Off" state="Low" isBranch="false"
    label="Complete
    > document and send to client" />
    > <folder cat="Off" state="Low" isBranch="false"
    > label="Interviews
    > and Transcripts" />
    > <folder cat="Off" state="High" isBranch="false"
    label="Set
    > Deployment
    > machine" />
    > <folder cat="Off" state="High" isBranch="false"
    label="send status
    > reports" />
    >
    > </folder>
    >
    > </folder>
    > </todolist>
    >
    >
    > MXML file............
    >
    > <?xml version="1.0" encoding="utf-8"?>
    > <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    > layout="absolute"
    > initialize="adgService.send()">
    >
    > <mx:HTTPService id="adgService" url="adg.xml"/>
    > <mx:AdvancedDataGrid
    >
    dataProvider="{adgService.lastResult.todolist.folder}">
    > <mx:columns>
    > <mx:AdvancedDataGridColumn headerText="Name"
    dataField="label"/>
    > <mx:AdvancedDataGridColumn headerText="Age"
    dataField="state"/>
    > </mx:columns>
    > </mx:AdvancedDataGrid>
    >
    > </mx:Application>
    >
    > Thnaks & Regards
    > edeewan
    Try
    <mx:AdvancedDataGrid
    dataProvider="{adgService.lastResult.folder}">

  • Using a (Adv)datagrid as an AdvancedDataGridRendererProvider

    HI
    I have nested array(Hierarchical) data. I want to display the toplevel array as depth1 in an Advanced Data Grid, then at depth 2 when the data (tree) is opened display the nested array in another grid(advanced or normal).
    This works to some degree, but as expected the item renderer renders a grid for each row of nested data.  What I want is one grid with all the nested data. The way nested data shows normally is to have both headers for each depth showing in the main grid.. I only want to show the headers and nested data if the user chooses to do so.
    I can arrange the data anyway that is needed, as I'm pulling it from mysql via php.
    This is my renderer (simple)
    <?xml version="1.0" encoding="utf-8"?>
    <VBox xmlns="http://www.adobe.com/2006/mxml" width="100%" height="200">
    <AdvancedDataGrid  dataProvider="{data}" width="100%" height="100%" >
    <columns>
    <AdvancedDataGridColumn dataField="pp_job_number" headerText="Job Number"/>
    <AdvancedDataGridColumn dataField="pp_short_description" headerText="Description"/>
    <AdvancedDataGridColumn dataField="approvalmanufacturing" headerText="Final Date"/>
    </columns>
    </AdvancedDataGrid>
    </VBox>
    This is my grid
    <AdvancedDataGrid sortExpertMode="true"
    id="contractsGrid" width="100%" height="100%" itemClick="openContractForEditting(event)"
    variableRowHeight="true" defaultLeafIcon="{null}"
    folderOpenIcon="{editImage}" folderClosedIcon="{editImage}"
    >
    <rendererProviders>
    <AdvancedDataGridRendererProvider
    columnIndex="1"
    columnSpan="0"
    depth="2"
    renderer="view.jobRenderForAdvancedDataGrid"/>
    </rendererProviders>
    <dataProvider>
    <HierarchicalData source="{contracts_array}" childrenField="jobinfo" />
    </dataProvider>
    </AdvancedDataGrid>
    I can get the grid the way I want but have depth issues.
    if I add dataField="jobinfo" to AdvancedDataGridRendererProvider and then change the renderers' data provider to dataProvider="{data.jobinfo}"
    Then I get all the nested data in one grid, BUT the grid is not nested it will only show up at depth 1, on top of all the main details.
    help
    TIA
    flash

    Figured it out, I had to nest my array.......
    Array
        [0] => Array
                [0] => Array
                        [contracts_id] => 2
                        [contract_number] => MD-BLD-LA-XXXXX-01
                        [property_name] => Blue Bus
                        [licensee_name] => Ripple Bus
                        [formated_contract_start_date] => Wed Jan 14th, 2009
                        [formated_contract_end_date] => Tue Mar 31st, 2009
                        [contract_recived] => 0
                        [main_contact] => Test User RJ1
                        [bu_contact] => fred ward
                        [licensor_name] => MediaBus
                        [brand_liaison] => fred ward
                        [brand_liaison_bu] => fred ward
                        [brand_manager] => fred ward
                        [children] => Array
                                [0] => Array
                                        [jobinfo] => Array
                                                [0] => Array
                                                        [pp_job_number] => MD-BR-LA-34527-01-FREDTEST
                                                        [pp_short_description] => FRED comments
                                                        [approvalmanufacturing] =>
                                                [1] => Array
                                                        [pp_job_number] => MD-BR-LA-34527-01-1234
                                                        [pp_short_description] => hh
                                                        [approvalmanufacturing] =>
                                                [2] => Array
                                                        [pp_job_number] =>
                                                        [pp_short_description] => comment
                                                        [approvalmanufacturing] =>

  • How to convert arraycollection into HierarchicalData?

    Hi,
         Anyone can tell that how to convert arraycollection(flat data) into HierarchicalData? Thanks in Advance.

    i give a example below. it conver flat arraycollection data and display in hierarchical manner in datagrid
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    [Bindable]
    public var myAC:ArrayCollection = new ArrayCollection([
    {category:'Friends', name:'Jon Hirschi', email:'[email protected]'},
    {category:'Friends', name:'Frank Krul', email:'[email protected]'},
    {category:'Friends', name:'Ryan Stewart', email:'r_stewart'},
    {category:'Family', name:'Zafira Ahmed', email:'[email protected]'},
    {category:'Family', name:'Shiraz Ahmed', email:'[email protected]'}]);
    ]]>
    </mx:Script>
    <mx:GroupingCollection id="myGC" source="{myAC}">
    <mx:Grouping>
    <mx:GroupingField name="category"/>
    </mx:Grouping>
    </mx:GroupingCollection>
    <mx:AdvancedDataGrid dataProvider="{myGC}" initialize="myGC.refresh()"
    width="300">
    <mx:columns>
    <mx:AdvancedDataGridColumn dataField="name" headerText="Contacts"/>
    <mx:AdvancedDataGridColumn dataField="email" headerText="Email"/>
    </mx:columns>
    </mx:AdvancedDataGrid>
    </mx:Application>
    If this example helps in ur question then give me mark.

  • Updating dataprovider causes mess when scrolling in AdvancedDataGrid

    Hi
    I have a problem using AdvancedDataGrid :
    I bind the ADG dataprovider to a XML in my model, like this :
           <mx:AdvancedDataGrid
                <mx:dataProvider>
                    <mx:HierarchicalCollectionView filterFunction="{model.filterFunction}" source="{hierarchicalData}"/>
                </mx:dataProvider>
                <mx:columns>   
                    <mx:AdvancedDataGridColumn labelFunction="{model.menuLabel}"/>
                 </mx:columns>
           </mx:AdvancedDataGrid>
        <fx:Declarations>
            <mx:HierarchicalData id="hierarchicalData" source="{model.myXML.xmlNode}"/>
        </fx:Declarations>
    When I start the application, the ADG displays poperly my model.
    Then I programmaticaly add a node to myXML in my model, the ADG renders it and adds a row. So far so good.
    Then when I scroll vertically in the ADG, some rows are added or removed, or the mouse highlighting jump to another line... Total mess.
    I read that this may be because ADG recycle renderers and so we have to override the "set data" function in renderer. But here I don't use renderer but labelFunction.
    And I don't have the problem when scrolling, until I change the dataprovider.
    Do you have an idea ?

    can you post your source project? you must be addding the node the array collec
    tion more then once??? maybe. I wouldnt be able to tell unless you posted your project and we can take a look at it.
    Miguel

  • AdvancedDataGrid: I cannot relate the selected cells to the dataprovider

    If you look at this
    http://livedocs.adobe.com/flex/3/langref/mx/controls/AdvancedDataGrid.html#selectedCells
    The selectedCells work fine if you have ungrouped data but when items are grouped the row index does not realte to the flat dataprovider but the grouped rows in the ADG display. This is annoying as I cannot relate the selected cells to the dataprovider.
    Any ideas how to get around this?

    Ok so if i write some text and all the words are of different sizes and i have to resize it using the transform tool, i cannot resize it unto the size i want. e.g.. i wrote this text "The Big Bold Sale" all the words are of different sizes and are grouped together, so when i resize it using transform tool all these words are resized differently "The big" becomes big, "bold" becomes little smaller and "sale" is not resized.. the image is attached.

  • AdvancedDataGrid.expandItem() fails when dataProvider is of type HierarchicalCollectionView

    1. I pas an instance of HierarchicalCollectionView to the dataProvider of my AdvancedDataGrid
    2. The hierarchical data is displayed fine
    3. expandItem() fails miserably:
    TypeError: Error #1034: Type Coercion failed: cannot convert mx.collections::ArrayCollection@c9f6e81 to mx.collections.IHierarchicalCollectionView.
         at mx.controls::AdvancedDataGrid/isItemOpen()[E:\dev\4.x\frameworks\projects\datavisualization\src\mx\controls\AdvancedDataGrid.as:4306]
         at mx.controls::AdvancedDataGrid/expandItem()[E:\dev\4.x\frameworks\projects\datavisualization\src\mx\controls\AdvancedDataGrid.as:4391]
    I'm using the HierarchicalCollectionView because it has the filterFunction property.

    1. I pas an instance of HierarchicalCollectionView to the dataProvider of my AdvancedDataGrid
    2. The hierarchical data is displayed fine
    3. expandItem() fails miserably:
    TypeError: Error #1034: Type Coercion failed: cannot convert mx.collections::ArrayCollection@c9f6e81 to mx.collections.IHierarchicalCollectionView.
         at mx.controls::AdvancedDataGrid/isItemOpen()[E:\dev\4.x\frameworks\projects\datavisualization\src\mx\controls\AdvancedDataGrid.as:4306]
         at mx.controls::AdvancedDataGrid/expandItem()[E:\dev\4.x\frameworks\projects\datavisualization\src\mx\controls\AdvancedDataGrid.as:4391]
    I'm using the HierarchicalCollectionView because it has the filterFunction property.

  • AdvancedDataGrid changing dataprovider bug infinite loop

    Make the second column width like this image and then click on addRow1:
    <code>
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application
    xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="library://ns.adobe.com/flex/mx"
    >
    <fx:Declarations>
    <s:ArrayCollection id="dp">
    <fx:Object descripcion="descripcion1" />
    <fx:Object descripcion="descripcion2" />
    <fx:Object descripcion="descripcion3" />
    <fx:Object descripcion="descripcion4" />
    </s:ArrayCollection>
    </fx:Declarations>
    <fx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    protected function btnAceptar_clickHandler(event:MouseEvent):void {
    var aux:ArrayCollection = new ArrayCollection(dp.toArray());
    var obj:Object = new Object();
    obj.descripcion = "descripcion" + dp.length;
    aux.addItem(obj);
    dp = aux;
    protected function button1_clickHandler(event:MouseEvent):void {
    var obj:Object = new Object();
    obj.descripcion = "descripcion" + dp.length;
    dp.addItem(obj);
    ]]>
    </fx:Script>
    <s:layout>
    <s:VerticalLayout />
    </s:layout>
    <s:Panel>
    <mx:AdvancedDataGrid id="grilla" dataProvider="{dp}" width="100%" height="100%"
    horizontalScrollPolicy="auto"
    >
    <mx:columns>
    <mx:AdvancedDataGridColumn dataField="descripcion" />
    <mx:AdvancedDataGridColumn dataField="descripcion" />
    </mx:columns>
    </mx:AdvancedDataGrid>
    </s:Panel>
    <s:Button label="addRow1" click="btnAceptar_clickHandler(event)" />
    <s:Button label="addRow1" click="button1_clickHandler(event)" />
    </s:Application>
    </code>

    When the width property is not used, it fails. I can't simplify more than this sorry.
    Steps:
    click on Fail button
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application
         xmlns:fx="http://ns.adobe.com/mxml/2009"
         xmlns:s="library://ns.adobe.com/flex/spark"
         xmlns:mx="library://ns.adobe.com/flex/mx"
         width="300" height="300"
         >
         <fx:Declarations>
              <s:ArrayCollection id="dp">
                   <fx:Object description1="description" description2="description"/>
                   <fx:Object description1="description" description2="description"/>
                   <fx:Object description1="description" description2="description"/>
                   <fx:Object description1="description" description2="description"/>
              </s:ArrayCollection>
         </fx:Declarations>
         <fx:Script>
              <![CDATA[
                   import mx.collections.ArrayCollection;
                   protected function fail_clickHandler(event:MouseEvent):void {
                        var obj:Object = new Object();
                        obj.descripcion = "description";
                        var aux:ArrayCollection = new ArrayCollection(dp.toArray());
                        aux.addItem(obj);
                        dp = aux;
              ]]>
         </fx:Script>
         <s:layout>
              <s:VerticalLayout />
         </s:layout>
         <mx:AdvancedDataGrid id="grid" dataProvider="{dp}" height="160" horizontalScrollPolicy="auto">
              <mx:columns>
                   <mx:AdvancedDataGridColumn dataField="description1" width="200"/>
                   <mx:AdvancedDataGridColumn dataField="description2" width="5"/>
              </mx:columns>
         </mx:AdvancedDataGrid>
         <s:Button id="fail" label="FAIL" click="fail_clickHandler(event)" />
    </s:Application>

  • How to change the order of groups in AdvancedDataGrid

    Hello,
    I have a dataset similar to the following:
    Region   Sales
    ======   ======
    North     10
    North     15
    South     5
    East      20
    West      5
    West      4
    West      3
    I'd like to group by Region and sort the groups by the Sales subtotal for each group. I already have the data grouped correctly using GroupingCollection2. How can I sort the groups by the sales subtotal (it sorts by region name by default)? I've seen some posts that talk about creating a custom groupingObjectFunction and applying a group sort. But I'm still confused. Can someone give me some pointers on how to achieve this?
    So ideally, the AdvancedDataGrid would end up looking like this with the regions sorted by sales subtotal;
    Region    Sales
    ======    ======
    North
              10
              15
    subtotal 45
    East
              20
    subtotal 20
    West
              5
              4
              3
    subtotal 12
    South
              5
    subtotal 5

    Thanks, I looked at that earlier but it doesn't contain the solution I was hoping to find.
    I ended up not using GroupingCollection. I think GroupingCollection is cool, but it isn't really customizable to the extent I need.
    I just ended up transforming my data into a hierarchical form that could be used directly by AdvancedDataGrid. At the top level of my hierarchy, I have the detail txn groups, subtotal groups, and grand total groups. To sort the groups, I use custom SortFields. So, for example, if I want to sort by group name, I add a SortField for the groupName attribute. Both the Detail Group and the Subtotal Group share the same group name. Then I add a SortField for a summaryRow attribute. Only the subtotal group has that attribute. This ensures that the Detail Group is always followed by the associated Subtotal Group after sorting. I store my groups in an XMLListCollection and then set the sort attribute, then call refresh().
    Not ideal, but it works. If my requirements were more complex, perhaps my approach wouldn't have worked as well. But as it stands it works well and has good performance.
    I was hoping that ADG could handle this kind of sorting for me, but after looking at the source code, it seems like this is not possible without implementing my own custom GroupingCollection class and possibly other supporting classes.
    One key thing to note is that clicking the column header to sort within groups works fine. However, if you then attempt to sort at the group level, ADG hangs while trying to refresh itself. The trick is to assign the dataProvider.sort attribute to a temporary variable, then set it to null (this sort variable contains the ADG column sorts that the user clicked). Apply your group level sort and then reapply the dataProvider.sort attribute.

Maybe you are looking for

  • Text messaging after the new software update

    i have not been able to text out since the update, it sits forever in the message window and i can type the message i want to send but when i hit send nothing happens, it sits for a few minutes and then says "failed to save message" . then goes blank

  • Changes to chart are not saved

    Hi, I open a query in BEx Analyzer, change the chart into a donut, and save it as a workbook. I close the workbook and open the workbook again. The chart is back of the 'bar'type, the donut has disappeared. How can I save the donut? or other layout I

  • PDF preview and display issue : NWDS 7.1 SP05 + ALD 7.1

    Hi All I am creating a webdynpro java application in NWDS 7.1 SP 05. This application has an interactive form ui element. The livecycle designer version is 7.1 and reader versions tried are 8 and 9. The issue is that the pdf preview in NWDS is blank

  • AppleTV 2 snowy picture

    While my AppleTV is booting, I can see the picture clearly. But after the boot, the picture gets snowy and intermittent. Unplugging and trying again does not help. I tried different HDMI cables and even switched HDMI ports on my TV, nothing seems to

  • 1076 songs in iTunes library, all of them checked, however only 961 songs go to iPhone... how to i change this??

    I have 1076 songs in my iTunes library but only 961 download to my iPhone.... Why? How do i get all of them to my iPhone.... and yes all of them are checked. Thanks