【DataGrid】重构问题
在网上看到这样的资料
<?xml version="1.0" encoding="utf-8"?>
<mx:DataGrid xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
override protected function drawRowBackground(s:Sprite, rowIndex:int, y:Number, height:Number, color:uint, dataIndex:int):void
{
var list:XMLList = new XMLList(dataProvider)
if(dataIndex < list.length() && list[dataIndex].@result <60)color = 0xFF6600
super.drawRowBackground(s,rowIndex,y,height,color,dataIndex);
}
]]>
</mx:Script>
</mx:DataGrid>
而我的DataGrid是用arraycollection绑定的,所以override protected function drawRowBackground(){。。。。应该如何写?}
以下是我写的可是报错
var array:Array = dataProvider as Array //ArrayCollection也不行
if(dataIndex < array.length && array[dataIndex].result >60)color = 0xFF6600
super.drawRowBackground(s,rowIndex,y,height,color,dataIndex);
[解决办法]
251897656 qq说