Updating DataGrid when updating DataProvider

I am working on an application using Flex, Adobe Air. I have a DataGrid with XML as my DataProvider. At runtime, my XML is updated. After updating and saving the XML, my DataGrid should also receive the update. I used the method Dataprovidername.refresh(), but it does not work.

+3
source share
4 answers

after updating the data, try manually sending the collection change event:

datagrid.dataProvider.dispatchEvent( new CollectionEvent(CollectionEvent.COLLECTION_CHANGE));
+5
source

, . MX Halo DataGrid AdvanceDataGrids , . . , dataprovider , . , dataprovider ICollectionView.

, "Array" "XML" dataprovider datagrid, datagrid ArrayCollection XmlListCollection dataprovider. / .

, " " datagrid, invalidateList(). , "invalidateDisplayList()" , . (Ones, ListBase).

+3

Have you created an XML Bindable variable ?:

[Bindable]
private var data:XML...
+1
source

I solved the problem of updating the data grid when changing the XML data of the data provider.

Instead of saving the XML document and loading it to the data provider in the data grid, I assigned the updated XML document to the data provider as a new provider. In this way, the binding update problem can be solved.

+1
source

Source: https://habr.com/ru/post/1733831/


All Articles