我正面臨一個問題,在我的Zend項目中,我需要在界面上顯示一些DB數據。 我選擇了jGrid(jQuery)作爲可以做子網格甚至是新網格的子網格。如何將jGrid整合到Zend 1中?
我搜索了「Zend + jgrid」,並完成了下載ZendX,Zend的擴展,並將其放入/庫。
我還添加條目的application.ini:
autoloadernamespaces[] = "ZendX"
resources.view.helperPath.ZendX_JQuery_View_Helper = "ZendX/JQuery/View/Helper"
pluginPaths.ZendX_Application_Resource = "ZendX/Application/Resource"
然後在佈局我加入: 回聲$這 - >的jQuery();
終於在視圖中我把:
$options = array(
"colModel" => array(
array(
"name" => "Inv No",
"id" => "id",
"index" => "id",
"width" => 75,
"align" => "center"
),
array(
"name" => "Date",
"id" => "invdate",
"index" => "invdate"
),
array(
"name" => "Client",
"id" => "name",
"index" => "name"
),
),
"rowNum" => 10,
"autowidth" => "true",
"rowList" => array(10, 20, 30),
"sortorder" => "desc",
"caption" => "Example"
);
$this->_helper->jgrid($options);
以下從this link 我得到了它是一個錯誤報告用例UC-1:
Fatal error: Call to a member function jgrid() on a non-object in D:\PROJEKTY\wtms_gui\application\views\scripts\jgrid\index.phtml on line 28
它指的是代碼行:
$this->_helper->jgrid($options);
我錯過了什麼,以及如何運行簡單的表jGrid從數組中獲取數據?
問候