【问题标题】:jqGrid cannot be appliedjqGrid 无法应用
【发布时间】:2013-09-27 11:05:01
【问题描述】:

我在我的 asp.net mvc4 项目中使用 jqGrid,在我的一个观点中,我有以下几点:

<table id="_componentGrid" cellpadding="0" cellspacing="0">
</table>
<div id="_componentPager" style="text-align: center;">
</div>

我有一个这样开头的 javascript 文件:

function showGrid() {
    $('#_componentGrid').jqGrid({
        caption: paramFromView.Caption,....

在运行时产生错误:

The object does not accept the property or method 'jqGrid'.

如何解决?

【问题讨论】:

    标签: javascript jquery asp.net-mvc-4 jqgrid


    【解决方案1】:

    该错误表示未加载 jqGrid。您应该验证grid.locale-en.jsjquery.jqGrid.min.js(或jquery.jqGrid.src.js)将在之后 jQuery 页面上加载。 jqGrid 和您在页面上使用的 jQuery 的 version 之间可能存在一般冲突。无论如何,我建议您打开有错误页面的源代码并验证其中的&lt;head&gt; 部分以及页面上使用&lt;script&gt; 的所有其他位置。加载的 JavaSctripts 框架和插件的顺序和版本可能很重要。我建议您将包含文件的顺序与My first grid jqGrid 文档示例中的顺序进行比较。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-05-13
      • 2020-04-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-20
      • 2013-03-10
      相关资源
      最近更新 更多