未捕获的异常:jqGrid-没有这样的方法:navGrid [英] uncaught exception: jqGrid - No such method: navGrid

查看:36
本文介绍了未捕获的异常:jqGrid-没有这样的方法:navGrid的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

jqGrid 3.8.1运行得比我更新的jqGrid 3.8.2更好.代码开始生成错误. 错误是:未捕获的异常:jqGrid-没有这样的方法:navGrid.下面是我的代码.

jqGrid 3.8.1 was working fine than I updated jqGrid 3.8.2. The code started generating error. Error is : uncaught exception: jqGrid - No such method: navGrid. Below is my code.

注意:如果我删除了下面的行,则表示Grid工作正常.为什么会这样?

Note: If I remove below line than Grid is working fine. Why is that?

jQuery("#lists55").jqGrid('navGrid', '#pagers55', { edit: false, add: false, del: false }); 

在ASP.NET MVC 3 Razor中使用它.

Using it in ASP.NET MVC 3 Razor.

<link href="@Url.Content("~/Content/themes/images/jquery-ui-1.8.7.custom.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/themes/ui.jqgrid.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/js/jquery-ui-1.8.7.custom.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/js/grid.locale-en.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/js/jquery.jqGrid.min.js")" type="text/javascript"></script>


jQuery().ready(function () {
    jQuery("#lists55").jqGrid({
        data: mydata1,
        datatype: "local",
        colNames: ['Inv No', 'Date', 'Client', 'Amount', 'Tax', 'Total', 'Notes'],
        colModel: [{ name: 'id', index: 'id', width: 55 },
            { name: 'invdate', index: 'invdate', width: 90 },
            { name: 'name', index: 'name asc, invdate', width: 100 },
            { name: 'amount', index: 'amount', width: 80, align: "right", formatter: 'number' },
            { name: 'tax', index: 'tax', width: 80, align: "right", formatter: 'number' },
            { name: 'total', index: 'total', width: 80, align: "right", formatter: 'number' },
            { name: 'note', index: 'note', width: 150, sortable: false }
        ],
        rowNum: 10,
        rowList: [10, 20, 30],
        pager: '#pagers55',
        sortname: 'id',
        viewrecords: true,
        sortorder: "desc",
        caption: "JSON Example",
        footerrow: true,
        userDataOnFooter: true,
        altRows: true
    });
    jQuery("#lists55").jqGrid('navGrid', '#pagers55', { edit: false, add: false, del: false }); 
});

推荐答案

我想您未检查

I suppose that you checked not all jqGrid modules which you needed during the jqGrid dounload. The navGrid function are used mostly for form editing functionality. So you should check "Form Edit" and "Common" modules from the "Editing" block.

如果要验证在jquery.jqGrid.min.js中使用的模块,可以使用文本编辑器将其打开,然后您将在文件开头的注释(通常在第8行)的注释中看到以下内容: :

If you want to verify which modules you use in the jquery.jqGrid.min.js you can open it with a text editor and you will see in the comment at the begining of the file text (typically in the line 8) starting with the following:

Modules: grid.base.js; jquery.fmatter.js; grid.custom.js; grid.common.js; grid.formedit.js; ...

如果找不到grid.formedit.js,则表明在下载jqGrid时确实没有选择表单编辑".

If you don't find grid.formedit.js, that you really not choose "Form Edit" during the jqGrid downloading.

这篇关于未捕获的异常:jqGrid-没有这样的方法:navGrid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆