« Bindable Read-Only Getters - Pipes Source Code »

AdvancedDataGrid - Adventures in Binding

18 September 2008

Quick post on AdvancedDataGrid dataProviders.

If your using a HierarchicalData provider for you AdvancedDataGrid (Flex) binding changes may (will) not be picked up by the AdvancedDataGrid.

For example


<mx:AdvancedDataGrid id="grid" bottom="10" top="40" left="10"
designViewDataType="tree" width="379">
<mx:dataProvider>
<mx:HierarchicalData source="{grades}"
childrenField="assignments"/>
</mx:dataProvider>
<mx:columns>
<mx:AdvancedDataGridColumn headerText="Course" dataField="title"/>
<mx:AdvancedDataGridColumn headerText="Score" dataField="scoreString" width="80"/>
</mx:columns>
</mx:AdvancedDataGrid>

Won’t pickup the update to ‘grades’. Instead you’ll need to update the dataProvider itself…


var hd:HierarchicalData = new HierarchicalData();
hd.childrenField = "assignments";
hd.source = grades;
grid.dataProvider = hd;


4 Responses to ' AdvancedDataGrid - Adventures in Binding '

Subscribe to comments with RSS or TrackBack to ' AdvancedDataGrid - Adventures in Binding '.

  1. Salman said,

    on September 19th, 2008 at 8:06 am

    How about:

    grid.dataProvider.refresh();

    You could possibly take it further and try something like:

    BindSetter( function( obj:Object ):void { grid.dataProvider.refresh(); }, yourObject, “grades” );

  2. Joshua said,

    on September 19th, 2008 at 4:16 pm

    Salman,
    Thanks for the reply.

    No, with a HierarchicalData dataProvider neither

    grid.dataProvider.refresh();

    nor

    BindingUtils.bindSetter(function( obj:Object ):void { grid.dataProvider.refresh(); }, this, “grades”);

    will solve the issue.

    You can find more details @ http://bugs.adobe.com/jira/browse/FLEXDMV-1334?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

  3. mani said,

    on October 13th, 2008 at 9:42 pm

    Joshua, thanks for the article!

    By the way, could you opensource the DynamicModules which in the follow source page?
    It is wonderful, and could help me a lot.

    http://www.joshuaostrom.com/demos/mortgagepipes/srcview/index.html

    Thanks~~

  4. Kazi said,

    on November 15th, 2008 at 5:26 pm

    Thanks Joshua,

    this really helped me!!!

Leave a reply

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

cheap generic kamagra kamagra uk viagra! Discount Viagra generic viagra levitra and cialis pills! "));