2013-03-28 28 views
1

我正在使用此php代碼來生成網格。如何從gqgrid獲取濾鏡數組

<?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" 
) 

,也有,我想在他們和顯示搜索在陣列像上面等領域。

回答

0

如果我理解正確你的問題,你應該從truefilterToolbarstringResult屬性的值更改爲false。選項stringResult: true使信息格式發送到與高級搜索兼容的服務器。所以filters參數將被髮送到服務器。