Created
October 30, 2009 17:32
-
-
Save rafaelrinaldi/222561 to your computer and use it in GitHub Desktop.
Util to remove DataGrid items.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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