在Flex中延迟渲染或强制重新渲染

时间:2023-01-15 19:08:28

In my Flex application, using a custom control, I am making a JSON request to grab some data from the server. My rendering depends on this data such as knowing how many boxes to draw. How can I either force the rendering to wait until I've got the data before drawing to screen or have the boxes draw once we receive the data?

在我的Flex应用程序中,使用自定义控件,我正在发出JSON请求以从服务器获取一些数据。我的渲染取决于这些数据,例如知道要绘制多少个框。我如何强制渲染等待,直到我在绘制到屏幕之前获得数据或者在我们收到数据后绘制框?

I have an event listener for Event.COMPLETE for my JSON request and in there, I call methods that add to the control. I've tried invalidateDisplayList but that doesn't seem to do anything for me?

我有一个Event.COMPLETE的事件监听器用于我的JSON请求,在那里,我调用添加到控件的方法。我尝试过invalidateDisplayList,但这似乎对我没有任何作用?

1 个解决方案

#1


0  

How about adding a 'blank' state to your component that would be active until you have the final data. This state could say "loading" for example. Then you change state and render the proper layout

如何在组件中添加“空白”状态,直到获得最终数据为止。例如,这种状态可以说是“加载”。然后,您可以更改状态并呈现正确的布局

#1


0  

How about adding a 'blank' state to your component that would be active until you have the final data. This state could say "loading" for example. Then you change state and render the proper layout

如何在组件中添加“空白”状态,直到获得最终数据为止。例如,这种状态可以说是“加载”。然后,您可以更改状态并呈现正确的布局