Ask a Question related to Macromedia Flex General Discussion, Design and Development.
-
Vimpact #1
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
-
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"... -
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... -
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... -
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... -
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... -
laurent pinson #2
Re: AdvancedDataGrid and HierarchicalData
you need to refresh your ADG.
try using yourADG.refresh() or yourADG.validateNow()
laurent pinson Guest
-
sameerb #3
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
-
Vimpact #4
Re: AdvancedDataGrid and HierarchicalData
Thanks sameerb! That solved it... that just seems totally backwards to me...
Vimpact Guest



Reply With Quote

