最初写法
修改后写法
覆盖data方法后不在报警告
<mx:List id="allActsList"
width="100%"
height="100%"
dragEnabled="true"
dropEnabled="true"
dragMoveEnabled="true"
allowMultipleSelection="true"
doubleClickEnabled="true"
dataProvider="{allActs}"
doubleClick="relateActs(allActsList.selectedItems, allActs, execActs);"
alpha="0.7"
showDataTips="true"
dataTipFunction="dataTipFunction"
alternatingItemColors="[0xF7F7F7, 0xFFFFFF]">
<mx:itemRenderer>
<mx:Component>
<mx:HBox horizontalScrollPolicy="off"
width="100%"
fontSize="12"
paddingTop="0"
paddingBottom="0"
horizontalAlign="left">
<mx:Label text="{data.scheduleName}"
width="90%"
paddingLeft="0"/>
<mx:Button label="修改"
width="10%"
click="outerDocument.updateActHandler()"/>
</mx:HBox>
</mx:Component>
</mx:itemRenderer>
</mx:List>
修改后写法
<mx:List id="allActsList"
width="100%"
height="100%"
dragEnabled="true"
dropEnabled="true"
dragMoveEnabled="true"
allowMultipleSelection="true"
doubleClickEnabled="true"
dataProvider="{allActs}"
doubleClick="relateActs(allActsList.selectedItems, allActs, execActs);"
alpha="0.7"
showDataTips="true"
dataTipFunction="dataTipFunction"
alternatingItemColors="[0xF7F7F7, 0xFFFFFF]">
<mx:itemRenderer>
<mx:Component>
<mx:HBox horizontalScrollPolicy="off"
width="100%"
fontSize="12"
paddingTop="0"
paddingBottom="0"
horizontalAlign="left">
<mx:Script>
<![CDATA[
override public function set data(value:Object):void
{
super.data=value;
scheduleTxt.text=value.scheduleName.toString();
}
]]>
</mx:Script>
<mx:Label id="scheduleTxt"
width="90%"
paddingLeft="0"/>
<mx:Button label="修改"
width="10%"
click="outerDocument.updateActHandler()"/>
</mx:HBox>
</mx:Component>
</mx:itemRenderer>
</mx:List>
覆盖data方法后不在报警告