【问题标题】:Empty Grid in jqgridjqgrid中的空网格
【发布时间】:2011-01-27 04:32:33
【问题描述】:

我正在尝试将网格集成到我的 PHP 项目中,JQgrid 看起来很简单!! 当我集成时,我只能看到网格,而不是网格中的数据! 我刚刚更改了示例代码的数据库设置以使用我的数据库。

调试结果:

  1. 当我使用 firebug 进行调试时,我能够在 firebug 的 consolde 模式下看到 db 行。

  2. 这里还粘贴了jqGrid.log的日志

  3. 它还会抛出一个警告消息“警告:日期()[function.date]:依赖系统的时区设置是不安全的。需要使用日期.timezone 设置或 date_default_timezone_set() 函数。如果您使用了这些方法中的任何一种,但仍然收到此警告,您很可能拼错了时区标识符。我们选择了 'America/New_York' 代替 '-5.0/no DST'在 C:\Users\Karthik\Desktop\apache\htdocs\php\jqGrid.php(1) 中:第 1 行的 eval() 代码"

这两个文件都位于根目录中。一些疑难解答的线索

PHP 代码“myfristgrid.php”

require_once 'jq-config.php';

// 包含 jqGrid 类

require_once "php/jqGrid.php";

require_once "php/jqGridPdo.php";

$conn = 新 PDO(DB_DSN,DB_USER,DB_PASSWORD);

$conn->query("SET NAMES utf8");

$grid = new jqGridRender($conn);

$grid->debug = true;

$grid->SelectCommand = 'SELECT * FROM question';

$grid->datatype = 'json';

$grid->setColModel();

$grid->setUrl('myfirstgrid.php');

$grid->setGridOptions(数组( "caption"=>"这是自定义标题", “行号”=>10, "排序名称"=>"id", “悬停”=>真, “行列表”=>数组(10,20,50), ));

$grid->setColProperty("id", array("label"=>"ID", "width"=>60));

// 享受

$grid->renderGrid('#grid','#pager',true, null, null, true,true);

$conn = null;


jqGrid.log

执行 2 个查询 - 2011-01-26 22:50:28 大批 ( [0] => 数组 ( [时间] => 2011-01-26 22:50:28 [查询] => SELECT COUNT(*) AS COUNT FROM question [数据] => [类型] => [字段] => [主要] => [输入] => )

[1] => Array
    (
        [time] => 2011-01-26 22:50:28
        [query] => SELECT * FROM question ORDER BY id asc LIMIT 0, 10
        [data] => 
        [types] => 
        [fields] => 
        [primary] => 
        [input] => 
    )

)


【问题讨论】:

  • 请贴出你用来生成jqgrid的代码。帮助你解决问题会很有帮助。

标签: jqgrid-php


【解决方案1】:

您无法在 jqGrid 中正确使用 setColProperty。

【讨论】:

    猜你喜欢
    • 2013-12-25
    • 1970-01-01
    • 2015-04-24
    • 2017-01-14
    • 1970-01-01
    • 2011-10-28
    • 2011-09-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多