Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Looks to me like you are overthinking this. Since you aren't doing anything in your getter/setters you could get rid of them and just mark your ArrayCollection as Bindable, then set it as the dataProvider for the DataGrid and be done:</p> <pre><code>&lt;fx:Script&gt; &lt;![CDATA[ [Bindable] public var gridData:ArrayCollecton = new ArrayCollection; public function loadGridData():void { // Whenever you change the gridData, the DataGrid will update appropriately. } ]]&gt; &lt;/fx:Script&gt; &lt;mx:DataGrid dataProvider="{gridData}"&gt;&lt;/mx:DataGrid&gt; </code></pre> <p>The problem with your existing code is likely that you are not dispatching a change event in your setter. Getting rid of the getter/setters allows the ArrayCollection to handle dispatching that event for you. Hope that helps.</p> <p>EDIT: Based on the updated question, you may want to try changing your renderer to look like this, which would help if your custom data object is not bindable.</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;s:MXDataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" focusEnabled="true"&gt; &lt;fx:Script&gt; &lt;![CDATA[ override public function set data(value:Object):void { super.data = value; image.source = value.url; } ]]&gt; &lt;/fx:Script&gt; &lt;mx:Image id="image" source="{data.url}" height="65" maintainAspectRatio="true" scaleContent="true"/&gt; </code></pre> <p></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload