【问题标题】:jqgrid not loading datajqgrid没有加载数据
【发布时间】:2010-12-25 20:10:31
【问题描述】:

我有一个将 json 数据推送到 jqgrid 的 RoR 应用程序。网格加载完毕,显示正确的页数/行数,但不显示任何行。

数据:

{
"total":333,
"page":1,
"records":3333,
"rows":[
    {"id":"267","cell":["42883","Enhancing Personal and Organizational Creativity (XP)","1"]},
    {"id":"268","cell":["42883","Enhancing Personal and Organizational Creativity","1"]},
    {"id":"266","cell":["42815","Strategic Decision Making (XP-Elective)","1"]},
    {"id":"265","cell":["42811","Strategic Planning","1"]},
    {"id":"264","cell":["42809","Best Practices in Innovation (XP)","1"]},
    {"id":"260","cell":["42808","Grave to Cradle - The Basics of Restructuring and Bankruptcies","1"]},
    {"id":"261","cell":["42808","Corporate Restructuring","1"]},
    {"id":"262","cell":["42808","Grave to Cradle Corporate Restructuring","1"]},
    {"id":"263","cell":["42808","Failure  - Grave to Cradle Corporate Restructuing (XP)","1"]},
    {"id":"259","cell":["42800","Competitive Strategy  (XP)","1"]}
    ]
}

html:

$("#list").jqGrid({
  url:courseSource + "/fulldata?instructor=" + instrId + "&course=" + courseId,
  datatype: 'json',
  mtype: 'GET',
  colNames:['Course Number','Course Title', 'Number of Instructors'],
  colModel :[
    {name:'course_no', index:'course_no', width:200},
    {name:'name', index:'name', width:500},
    {name:'ins_count', index:'ins_count', width:260, align:'right'}
  ],
  pager: '#pager',
  rowNum:10,
  rowList:[10,20,30],
  sortname: 'course_no',
  sortorder: 'desc',
  viewrecords: true,
  caption: 'Courses'
});

有什么想法吗?我在这里迷路了 - 我已经解决了常见问题 - 在 jqgrid.js 之前加载了语言环境,加载了 css,加载了 jquery 和朋友。怎么回事?

【问题讨论】:

    标签: jquery ruby-on-rails jqgrid


    【解决方案1】:

    我想您在问题中发布的代码之外还有一些小问题。将您的完整 HTML 页面与 the following page 进行比较。它有你的代码和你的 JSON 数据。您可以看到所有工作都没有任何问题。因此,您描述的问题必须在发布的代码之外

    【讨论】:

    • 看起来问题出在当前的 chromium 版本上。您的页面在 safari 中效果很好,但在 chromium 中效果不佳。截图见这里:kolosy.com:810/jqgrid.png
    • 更重要的是 - 这仅体现在我在 os x 上构建的 chromium (6.0.398.0 (46565)) 上。 chrome、firefox 3.6、firefox 4 和 safari 运行良好。
    • @kolosy:抱歉,您的问题是关于 jqGrid,而不是关于异国情调网络浏览器的复古版本。我下载了当前版本的 Chromium 网络浏览器(版本 10.0.622.0 (70153)),我的示例在 Windows 7 下的浏览器中运行没有任何问题。所以我建议您尝试更新您的 Chromium 浏览器。祝你好运。
    • 是的 - 就是这样。我的印象是我正在运行最新的版本,但我想我从 4 月开始就有了。哎呀。当前的一个虽然有效。谢谢。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-08-19
    • 1970-01-01
    • 1970-01-01
    • 2011-08-11
    • 1970-01-01
    • 1970-01-01
    • 2012-03-02
    相关资源
    最近更新 更多