Skip to content

Instantly share code, notes, and snippets.

@rafaelrinaldi
Created October 30, 2009 17:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafaelrinaldi/222561 to your computer and use it in GitHub Desktop.
Save rafaelrinaldi/222561 to your computer and use it in GitHub Desktop.
Util to remove DataGrid items.
package rinaldi.utils {
import mx.controls.DataGrid;
/**
*
* Util to remove DataGrid items.
*
* @param p_grid DataGrid instance.
* @param p_indices Indices to be removed.
*
**/
public function removeDataGridIndices( p_grid : DataGrid, p_indices : Array ) : void
{
var data : Array = [];
for each(var indice : Number in p_indices) {
p_grid.dataProvider[indice] = null;
}
for each(var item : Object in p_grid.dataProvider) {
if(item != null) {
data.push(item);
}
}
p_grid.dataProvider = data;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment