External data in TileList Flex
Posted
by Adam
on Stack Overflow
See other posts from Stack Overflow
or by Adam
Published on 2010-03-12T00:44:59Z
Indexed on
2010/03/12
0:47 UTC
Read the original article
Hit count: 334
I'm working for the first time with a TileList and an itemRenderer and I'm having a bit of trouble getting the information from my array collection to display and looking for some advice. Here's what I've got
private function loadData():void{
var stmt:SQLStatement = new SQLStatement();
stmt.sqlConnection = sqlConn;
stmt.text = "SELECT * FROM tbl_user ORDER BY user_id ASC";
stmt.execute();
var result:SQLResult = stmt.getResult();
acData = new ArrayCollection(result.data);
}
<mx:TileList id="userlist" labelField="user_id" dataProvider="{acData}" width="600" height="200" paddingTop="25" left="117.15" y="327.25"> <!--itemClick="showMessage(event)"-->
<mx:itemRenderer>
<mx:Component>
<mx:VBox width="125" height="125" paddingRight="5" paddingLeft="5" horizontalAlign="center">
<mx:Label id="username" text="{}"/>
<mx:Label id="userjob" text="{}"/>
</mx:VBox>
</mx:Component>
</mx:itemRenderer>
</mx:TileList>
So I'm just not sure how I go about pulling the information from the array and putting it into labels like username, userjob, userbio ect, Inside the TitleList and itemRenderer.
© Stack Overflow or respective owner