开发者

datagrid use data of auto selectedIndex - data race - Flex

I have a datagrid that loads contnet from a database.

Once the data has been loaded I have a function that has selectedIndex=0;

Right after that I call another function that tries to display the selected item across a couple of la开发者_运维技巧bels.

The problem is nothing loads in the labels unless I run the functions twice.

I'm guessing its some sort of data race problem where the item hasn't been selected by the time the function that displays the items in labels runs.

So whats the workaround how can I get the item to be selected before the next function runs.


Put your next function call in a callLater();

selectedIndex = 0;
callLater(function():void {
    //nextFunction()
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜