Select to view content in your preferred language

custom class for datagrid - how do I update datagrid once the dataprovider changes?

622
0
12-05-2011 10:33 AM
TracySchloss
Honored Contributor
I am building a custom class for a datagrid based on the outFields specified in a featurelayer.  I want to add listeners for the change event on the map and only populate the grid with the features in the current map extent.  The datagrid comes up in a TitleWindow.

This works fine for the initial load.  If I'm zoomed in, only those features in the extent are loaded into the grid.  When I pan/zoom, the extent change handler, onExtentChange runs.  A new arrayCollection is created based on what is in the current map extent and defined as the new dataprovider to the grid.  This arrayCollection has the right elements in it.  I can't get the datagrid to use this new AC as the dataprovider!  I've tried defining the ArrayCollection at the start and I've tried creating a new one within the function.  I'm not sure that makes any difference, but I'm trying all sorts of things at this point.

I've tried refreshing the arraycollection.  I've tried invalidateList.  I've tried firing a dispatchevent on the collection change of the arraycollection.  Nothing changes the display.  I'm not sure what else to even try!

When I search the forums, all I find are the last questions I've posted  myself on syncing datagrid to map extents.  I guess not many people are trying to do this?!  I
Tags (2)
0 Kudos
0 Replies