如何停止将数据行附加到我的数据网格?我在状态之间切换。每次我回到 update_dg_form 状态时,都会将额外的 networkInfo 行添加到数据网格中。
private function update_dg(event:MouseEvent):void
{
var ntf:Vector.<NetworkInterface> = NetworkInfo.networkInfo.findInterfaces();
for each (var interfaceObj:NetworkInterface in ntf)
{
networkInfo.addItem({"dg_display_name" : interfaceObj.displayName, "dg_mac_address" : interfaceObj.hardwareAddress});
}
currentState = 'update_dg_form';
}
<mx:DataGrid id="network_adapter" includeIn="update_dg_form" x="55" y="280" width="516" height="111" dataProvider="{networkInfo}" selectedIndex="0">
<mx:columns>
<mx:DataGridColumn dataField="dg_display_name" headerText="Network Adapter"/>
<mx:DataGridColumn dataField="dg_mac_address" headerText="MAC Address"/>
</mx:columns>
</mx:DataGrid>