简体   繁体   English

Flex 3(ActionScript)查询数据集的记录集数组

[英]Flex 3 (Actionscript) query for recordset array for data grid

Hey, all. 大家好。 I am building an application in Flex Builder 3. Yes, I know that it has an auto-magic feature to build datasheet, but that will not work. 我正在Flex Builder 3中构建应用程序。是的,我知道它具有构建数据表的自动魔术功能,但这将不起作用。 I see many Flex controls, such as combo box, can take an array as a data source. 我看到许多Flex控件(例如组合框)都可以将数组作为数据源。

My question, therefore, is (1) How do I send the request from my action script to my PHP form to request a record set. 因此,我的问题是(1)如何将操作脚本中的请求发送到PHP表单以请求记录集。 (2) Presuming that my dataset is in a PHP assoc array, how do I format it to send it back to Action Script. (2)假设我的数据集在PHP assoc数组中,如何格式化它以将其发送回Action Script。 (3) How do I take the data received from the recordset, and put it inot an actionscript array, suitable for use as a data source. (3)如何获取从记录集接收的数据,并将其放入适合用作数据源的动作脚本数组中。

I can connect to my database in PHP, and query it just fine, so I don't need help with that. 我可以使用PHP连接到我的数据库,并对其进行查询,所以我不需要任何帮助。 For consistency, and humor, lets presume that I have the following data in an assoc array that I pulled from a database. 为了保持一致性和幽默感,请假设我在从数据库中提取的assoc数组中具有以下数据。

Array ( [0] => Array ( [name] => Kirk [shirt] => Gold [assign] => Bridge ) 数组([0] =>数组([名称] =>柯克[衬衫] =>黄金[分配] =>桥)

[1] => Array ( [name] => McCoy [shirt] => Blue [assign] => Sick Bay ) [1] =>数组([名称] => McCoy [衬衫] =>蓝色[assign] => Sick Bay)

[2] => Array ( [name] => Scotty [shirt] => Red [assign] => Engineering ) [2] =>数组([名称] => Scotty [衬衫] =>红色[assign] =>工程)

[3] => Array ( [name] => Spock [shirt] => Blue [assign] => Bridge ) [3] =>数组([name] => Spock [shirt] => Blue [assign] => Bridge)

[4] => Array ( [name] => Uhura [shirt] => Red [assign] => Bridge ) [4] =>数组([name] => Uhura [shirt] => Red [assign] => Bridge)

[5] => 1 ) [5] => 1)

I find it easier to send a request that retrieves the data from the PHP in XML format. 我发现发送以XML格式从PHP检索数据的请求更容易。 Then inside the Flex application, turn it into an ArrayList and use it with your controls. 然后在Flex应用程序内部,将其转换为ArrayList并与控件一起使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM