我有一个简单的应用程序,它目前正在从数据库中获取信息,并将内容显示到数据网格中。
我不想将这些信息显示在数据网格中,而是将其显示在几个标签中(名字、姓氏、电话等),但我不确定如何去做。
目前在creationComplete 我调用我的php 查询函数- 看起来像这样。
public function getPeople() {
return mysql_query("SELECT * FROM tbl_people ORDER BY pers_name ASC");
}
然后我只是将我的结果放入数据网格中
<mx:DataGrid id="empdg" x="22" y="184" dataProvider="{amfcall.getPeople.lastResult}" click="showName()">
<mx:columns>
<mx:DataGridColumn headerText="ID" dataField="pers_id" editable="false"/>
<mx:DataGridColumn headerText="Name" dataField="pers_name"/>
<mx:DataGridColumn headerText="Image" dataField="pers_img"/>
<mx:DataGridColumn headerText="Job" dataField="pers_job"/>
<mx:DataGridColumn headerText="Bio" dataField="pers_bio"/>
</mx:columns>
</mx:DataGrid>
最终我的查询将被修改,并且只会从数据库中返回 1 行。那么如何让结果显示在标签而不是数据网格中呢?