AdvancedDataGrid and HierarchicalData

Ask a Question related to Macromedia Flex General Discussion, Design and Development.

  1. #1

    Default AdvancedDataGrid and HierarchicalData

    I'm having a problem with the AdvancedDataGrid and HierachicalData. I have an
    HTTPService that is getting data from an XML file off the server. I have a
    comboBox that changes which data is currently displayed in an advancedDataGrid.
    The problem is that when I choose a different item in the comboBox the data is
    not changing in the advancedDataGrid. I'm using HierachicalData and setting
    it's source to the comboBox's data. Everything else on the page is updating
    fine when I change the comboBox. Any idea why the data grid wouldn't?

    <mx:AdvancedDataGrid>
    <mx:dataProvider>
    <HierachicalData source="{XML(posCombo.selectedItem).estimator.area }"/>
    </mx:dataProvider>
    <mx:columns>
    <mx:AdvancedDataGridColumn dataField="@name" headerText="Area"/>
    <mx:AdvancedDataGridColumn dataField="@wt" headerText="Weight"/>
    </mx:columns>
    </mx:AdvancedDataGrid>

    This is the XML...

    <position name="Manager">
    <estimator>
    <area name="1">
    <prod name="test1" wt="0.55"/>
    <prod name="test2" wt="0.65"/>
    </area>
    <area name="2">
    <prod name="test3" wt="0.45"/>
    <prod name="test4" wt="0.35"/>
    </area>
    <estimator>
    </position>
    <position name="Representative">
    <estimator>
    <area name="1">
    <prod name="test5" wt="0.24"/>
    <prod name="test6" wt="0.45"/>
    </area>
    <area name="2">
    <prod name="test7" wt="0.46"/>
    <prod name="test8" wt="0.75"/>
    </area>
    <estimator>
    </position>

    Thanks!

    Vimpact Guest

  2. Similar Questions and Discussions

    1. Question for AdvancedDataGrid?
      Hi, I did a AdvancedDataGrid without grouping,it works fine. <mx:AdvancedDataGri d x="8" y="72" width="558" height="247" rowCount="4"...
    2. AdvancedDataGrid Sorting
      I'm having a problem getting an AdvancedDataGrid to sort data in the proper order. I'm using a GroupingCollection as the dataprovider and I have...
    3. AdvancedDataGrid styling help
      Hello, I am trying to style an ADG such that certain horizontal lines in the grid are rendered with larger line thicknesses. I have tried a...
    4. Could not resolve <mx:AdvancedDataGrid>
      hi, all, I don't have much experience on Flex, and I met this problem when I try to open my mxml on Tomcat: Could not resolve...
    5. AdvancedDataGrid HierarchicalData dataProvider refreshissue
      Hi, I have an AdvancedDataGrid that uses a HierarchicalData dataProvider. The data is returned from the server as XML. I am using Cairngorm, so...
  3. #2

    Default Re: AdvancedDataGrid and HierarchicalData

    you need to refresh your ADG.

    try using yourADG.refresh() or yourADG.validateNow()
    laurent pinson Guest

  4. #3

    Default Re: AdvancedDataGrid and HierarchicalData

    Just extend from HierarchicalData, override set source() and dispatch a
    collection_change reset event -

    package
    {
    import mx.collections.HierarchicalData;
    import mx.events.CollectionEvent;
    import mx.events.CollectionEventKind;

    public class ModifiedHierarcihcalData extends HierarchicalData
    {
    override public function set source(value:Object):void
    {
    super.source = value;
    var event:CollectionEvent =
    new CollectionEvent(CollectionEvent.COLLECTION_CHANGE) ;
    event.kind = CollectionEventKind.RESET;
    dispatchEvent(event);
    }
    }
    }

    Then use ModifiedHierarchicalData in your Application -

    <mx:AdvancedDataGrid>
    <mx:dataProvider>
    <ModifiedHierarchicalData
    source="{XML(posCombo.selectedItem).estimator.area }"/>
    </mx:dataProvider>

    - Sameer
    [url]http://techrays.wordpress.com/[/url]

    sameerb Guest

  5. #4

    Default Re: AdvancedDataGrid and HierarchicalData

    Thanks sameerb! That solved it... that just seems totally backwards to me...
    Vimpact Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139