Flex DataGrid数据提供程序作为PHP函数 [英] Flex DataGrid dataprovider as a PHP function

查看:130
本文介绍了Flex DataGrid数据提供程序作为PHP函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!

我是新来的,有一个问题.

我可以使用ZendAMF在Flex中使用此MXML通过PHP函数填充Flex dataGrid:

Hi all!

I''m new here, and I have a question.

I can populate a Flex dataGrid with a PHP function through ZendAMF using this MXML in Flex:

<mx:DataGrid x="5.684342E-14" y="0" width="100%" height="100%" editable="false" id="browsegrid" styleName="usermapgrid" dataProvider="{amfcall.getItems.lastResult}" creationComplete="amfcall.getItems()" fontFamily="Verdana" itemClick="itemClickEvent();">



但是,一旦我尝试从需要传递变量的函数中使用相同的返回类型填充它,它就无法加载信息,但不会显示错误.

这是问题的MXML:



But as soon as I try to populate it with the same return type from a function that requires a variable to be passed, it fails to load the info, but doesn''t show an error.

Here is the MXML of the problem:

<mx:DataGrid x="0" y="0" styleName="usermapgrid" height="100%" width="100%" dataProvider="{amfcall.searchItems(searchstring).lastResult}" creationComplete="amfcall.searchItems(searchstring)">



以及对应的PHP函数:



And the corresponding PHP function:

public function searchItems($search){
    $result=mysql_query("SELECT * FROM tbl_items WHERE item_name OR item_tags LIKE '%$search%'");
    return $result;
}




当我在没有Flex的情况下进行测试时,PHP可以正确返回.

(我正在使用Flex SDK 3.2)

感谢您的帮助X | !




The PHP is returning properly when I test without Flex.

(I''m using Flex SDK 3.2)

Thanks for any help X| !

推荐答案

搜索){


result = mysql_query(" 选择*来自tbl_items的item_name或item_tags类似于'%
result=mysql_query("SELECT * FROM tbl_items WHERE item_name OR item_tags LIKE '%


search%'"); 返回
search%'"); return


这篇关于Flex DataGrid数据提供程序作为PHP函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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