在数组中的Flex显示分离数据组中、数据、Flex

2023-09-08 15:04:41 作者:失宠的猫

我是新来的弯曲/ Flash Builder中,我需要从一个文本文件中读取数据,然后切片成碎片我开始在我的自定义类。

I'm new to flex/flash builder, i need to read in data from a text document, then slice it into pieces i set out in my custom class.

这一切至今工作

var theCustomer:Customer=new Customer(name,address,phoneNo,comment,custNo);
custArray.addItem(theCustomer);

所以,现在我想要做的是只显示从每个条目的数组到组合框的名字 - 然后在接近它会显示所有的细节到一个列表框

So now what i want to do is display only the name from each entry of the array into a combobox - and then on close it will display all the details into a list box

如果我只是custArray绑定到它显示的组合框名称:地址:PHONENO:评论:custno违背为我设置出来,但就像我说我只是想名字让我怎么从数组??

If i just bind the custArray to the combobox it displays name:address:phoneNo:comment:custNo as i set it out, but like i said i want only the name so how do i separate the name from each Customer entry in the array ??

任何帮助,你是真棒,并在此先感谢!

Any help you be awesome and thanks in advance !!!

推荐答案

如果我正确理解你的问题,我想你想的组合框的labelField属性设置。这指定字段中的源的数据对象中的标签来使用。

If I'm understanding your question correctly, I think you want to set the labelField property on the combobox. This specifies the field in the source data objects to use in the label.

<s:ComboBox dataProvider="{custArray}" labelField="name"/>