我使用项呈示器完成了分层数据网格。一切都很好。我有很多数据要显示在网格中,因此每次加载数据时都会显示滚动条。拖动滚动条时,项呈示器无法正常工作,并且缺少少量数据列数据。我知道如何解决此问题。
在此处找到图片Image click
请检查以下代码: - ` width =“100%”height =“100%” textAlign =“center”autoDrawBackground =“false”>
<fx:Script>
<![CDATA[
import com.hp.pmm.common.ImageLibrary;
import mx.collections.ArrayCollection;
import mx.controls.Alert;
import mx.resources.ResourceManager;
private var _data:Object;
override public function set data(value:Object):void
{
super.data = value;
var showButton:String= '';
var i:int=0;
var j:int=0;
var showDataForChildren:String;
if(value.hasOwnProperty("Data_Transfer"))
{
showButton = value.Data_Transfer;
if (showButton == "Show_Button") {
startId.visible= true;
startId.includeInLayout= true;
abortId.visible= true;
abortId.includeInLayout= true;
imgStatus.visible=false;
lblStatus.visible= false;
imgStatus.includeInLayout= false;
lblStatus.includeInLayout= false;
}else {
lblStatus.text = "--";
startId.visible= false;
abortId.visible= false;
startId.includeInLayout= false;
abortId.includeInLayout= false;
imgStatus.includeInLayout= true;
lblStatus.includeInLayout= true;
}
}
}
public function clickedOnStart(event:Event):void{
var startEvent:Event = new Event("clickOnStartButton");
var parent:EventDispatcher = parentDocument.parentDocument as EventDispatcher;
if (parent != null)
{
parent.dispatchEvent(startEvent);
}
}
public function clickedOnAbort(event:Event):void{
var abortEvent:Event = new Event("clickOnAbortButton");
var parent:EventDispatcher = parentDocument.parentDocument as EventDispatcher;
if (parent != null)
{
parent.dispatchEvent(abortEvent);
}
}
]]>
</fx:Script>
<s:HGroup width="100%" gap="5" verticalAlign="middle" horizontalAlign="left" height="100%">
<!--<mx:Image id="imgStatus"/>
<mx:Label id="lblStatus" textAlign="left" showTruncationTip="true" paddingTop="3"/>-->
<s:HGroup verticalAlign="middle" horizontalAlign="center">
<mx:Button label="Start" id="startId" click="clickedOnStart(event)" width="40" height="20"/>
<mx:Button label="Abort" id="abortId" click="clickedOnAbort(event)" width="40" height="20"/>
</s:HGroup>
<s:HGroup height="100%">
<mx:Image id="imgStatus"/>
<mx:Label id="lblStatus" textAlign="left" showTruncationTip="true" paddingTop="3" />
</s:HGroup>
</s:HGroup>
`
答案 0 :(得分:0)
在没有看到任何代码的情况下,我会猜测这是项目渲染器的工作方式的问题。它们被回收并且在过去也给我带来了问题。我愿意打赌你的数据在第一次加载时会正确显示,并且在你开始滚动之前不会开始搞乱。
查看Google搜索结果:
编辑: 添加以下代码以响应提供的示例代码
if(value.hasOwnProperty("Data_Transfer"))
{
showButton = value.Data_Transfer;
if (showButton == "Show_Button") {
startId.visible= true;
startId.includeInLayout= true;
abortId.visible= true;
abortId.includeInLayout= true;
imgStatus.visible=false;
lblStatus.visible= false;
imgStatus.includeInLayout= false;
lblStatus.includeInLayout= false;
}else {
lblStatus.text = "--";
startId.visible= false;
abortId.visible= false;
startId.includeInLayout= false;
abortId.includeInLayout= false;
imgStatus.includeInLayout= true;
lblStatus.includeInLayout= true;
}
}
else
{
//set all values to your equivalent of no data
}