1

我正在使用这个 php 代码来生成一个网格。

<?php

//ini_set("display_errors","1");
require_once 'grid/jq-config.php';
// include the jqGrid Class
require_once "grid/jqGrid.php";
// include the driver class
require_once "grid/jqGridArray.php";

// include the calendar
require_once "grid/jqCalendar.php"; 

// include the document class 
require_once "lib/document.php";
// include heler.php which contain some helper functions
require_once "lib/helper.php";
// create the array connection
$conn = new jqGridArray();
// Create the jqGrid instance
$grid = new jqGridRender($conn);


echo $_REQUEST["filters"]; 

当用户通过工具栏搜索时,我希望通过 $_REQUEST 变量进行参数搜索并传递给我的函数并返回新结果。

的结果echo $_REQUEST["filters"];

{\"groupOp\":\"AND\",\"rules\":[{\"field\":\"BatchNumber\",\"op\":\"bw\",\"data\":\"56\"},{\"field\":\"SenderCode\",\"op\":\"bw\",\"data\":\"string1\"},{\"field\":\"ReceiverCode\",\"op\":\"bw\",\"data\":\"string2\"}]}{"records":0,"page":0,"total":0,"rows":false}

我希望结果像

$filter = array("BatchNumber" => 56 , 
"SenderCode" => "string1",
"ReceiverCode" => "string2"
 )

还有其他字段我想在其中搜索并显示在上面的数组中。

4

1 回答 1

0

如果我正确理解您的问题,您应该将filterToolbarstringResult的属性 值从更改为。选项使发送到服务器的信息格式与高级搜索兼容。所以过滤器参数将被发送到服务器。truefalsestringResult: true

于 2013-03-28T11:56:05.897 回答