flex3 - flex 3 遍历对象值

标签 flex3 iteration loops

我有一个代表数据库表的对象。我想遍历这个对象并打印打印每个值。我可以用什么来做到这一点?

我想在我的 mxml 中执行此操作而不是 actionscript

对于每个对象属性,我想创建一个输入字段

最佳答案

查找有关 Flex 3 循环的文档。如果你这样做了,你会发现:

for..in

The for..in loop iterates through the properties of an object, or the elements of an array. For example, you can use a for..in loop to iterate through the properties of a generic object (object properties are not kept in any particular order, so properties may appear in a seemingly random order):

var myObj:Object = {x:20, y:30};
for (var i:String in myObj)
{
    trace(i + ": " + myObj[i]);
}
// output:
// x: 20
// y: 30
与其尝试为每个对象创建一个输入字段,我建议您查看 DataGrid和定制 ItemEditors .

关于flex3 - flex 3 遍历对象值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/674158/

相关文章:

apache-flex - 如何将数据网格导出到 Flex 中的 Excel 文件?

python - 为什么 Python 中的元素对于...在...: statements use byValue behavior?

windows - 对迭代文本文件运行批处理命令

javascript - 迭代对象属性

algorithm - 如何正式地解释一些操作?

apache-flex - Adobe Flex & Air - 在 native 安装中打包 Air 应用程序

flash - 如何保护swf文件不被反编译?

Javascript 处理来自 ajax 请求的不同响应,并且 response.length = undefined

apache-flex - 在ActionScript 3.0中以编程方式在Adobe Air和Adobe Flex之间进行检测

java - for() 语句指令顺序