Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>New answer :) I will delete the old one if this helps.</p> <p>I haven't used Spark DataGrid yet, was expecting it to behave like a List.</p> <p>Found this in this in some comments in the source for this method of DataGrid:</p> <pre><code>public function invalidateCell(rowIndex:int, columnIndex:int):void </code></pre> <p>You can invalidate an entire row/col by passing -1 for the other value. In the quote from the docs below, you can also use dataProvider.itemUpdated()</p> <blockquote> <p>If the specified cell is visible, it is redisplayed. If variableRowHeight=true, then doing so may cause the height of the corresponding row to change. If columnIndex is -1, then the entire row is invalidated. Similarly if rowIndex is -1, then the entire column is invalidated.</p> <p>This method should be called when there is a change to any aspect of the data provider item at rowIndex that might have some impact on the way the specified cell is displayed. Calling this method is similar to calling the dataProvider.itemUpdated() method, which advises the Grid that all rows displaying the specified item should be redisplayed. Using this method can be relatively efficient, since it narrows the scope of the change to a single cell.</p> </blockquote> <p>Now I finally know where the itemUpdated() method on collections (ArrayCollection, ListCollectionView) can actually be used!</p> <p>[edit]</p> <p>Give your grid an id:</p> <pre><code>&lt;s:DataGrid id="lowerDataGrid" dataProvider="{_myData}"&gt; </code></pre> <p>Then you should be able to do this in your <code>addRow()</code> method after updating the collection:</p> <pre><code>lowerDataGrid.invalidateCell(item.rowNmber -1, 1); // assuming rowNumbers are 0 based </code></pre>
 

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