Flex Datagrid 选择多行并发送到 amfphp 后端 [英] Flex Datagrid select multiple rows and send to amfphp backend

查看:22
本文介绍了Flex Datagrid 选择多行并发送到 amfphp 后端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在互联网上的论坛上研究了一些解决方案,以将 ArrayCollection 发送到 AmfPHP,但我没有找到好的回应,以及如何访问 PHP 端的数组以包含到 MySQL 表中.

I was researching over the forums around the internet for some solution to send and ArrayCollection to AmfPHP but I didn't find good responses for that and how I can access the array on PHP side to include into a MySQL table.

我的问题:

我有一个填充了一些姓名和电子邮件的 Flex 数据网格,我想创建一种方法来允许用户创建一个组并选择名称作为该组的一部分.我在 Flash Builder 调试器中看到数据作为 ArrayCollection 发送良好(也从 Vector 转换为 Object),问题仍然是我如何在 PHP 端访问这个数组.

I have a Flex datagrid populated with some Name and Email and I want create a way to permit users to create a group and select the Name to be part of this group. I saw in Flash Builder debugger that the data are being send good as ArrayCollection (transformed from Vector to Object also) and the problem still in how can I access this array on PHP side.

这是发送到 AmfPHP 的 ArrayCollection:

Here is ArrayCollection being send to AmfPHP:

[0] Object (@cf87311)   
[1] Object (@d4bfcb9)   
[2] Object (@d4d3479)   

这是数组的键和值:

[0] Object (@cf87311)   
    id  "2" 
    nome    "David" 
    username    "david" 
[1] Object (@d4bfcb9)   
    id  "3" 
    nome    "jose"  
    username    "jose@jose.com" 
[2] Object (@d4d3479)   
    id  "4" 
    nome    "joao"
    username    "joao@joao.com" 

有谁知道我必须做什么才能访问这个数组中的字段id"?

Does anyone know what I have to do to have access to the field "id" in this array ?

最好的问候!

拉斐尔·塔瓦雷斯

推荐答案

AMFPHP 会将您的 actionscript 对象转换为 PHP 对象.将数组集合作为一个参数传递.在 PHP 方面,您可以将其用作:

AMFPHP will translate your actionscript object into a PHP object. Pass the arraycollection as one param. On the PHP side you would use it as:

function myfunction( $Object_param )
{
   foreach( $Object_param as $Object )
   {
       echo $Object[ 'id' ];
       echo $Object[ 'nome' ];
   }
}

等等.

这篇关于Flex Datagrid 选择多行并发送到 amfphp 后端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆