如何在最新的免费jqgrid中修复filterToolbar中的异常 [英] how to fix exception in filterToolbar in latest free jqgrid

查看:61
本文介绍了如何在最新的免费jqgrid中修复filterToolbar中的异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用

$(function () {
    $grid.jqGrid('filterToolbar', { // this is line myapp.js:797 in stack trace below
        stringResult: true,
        searchOnEnter: true,
        defaultSearch: 'cn'
    });
});

使用来自github的最新jqgrid会导致filterToolbar出错:

Using latest jqgrid from github this causes error in filterToolbar :

Uncaught TypeError: Cannot read property 'toUpperCase' of undefined
url http://localhost:52216/admin/Scripts/jqgrid/js/jquery.jqgrid.src.js
lineNumber  8924    column  24

如何解决这个问题?
堆栈跟踪如下。

How to fix this ? Stack trace is below.

TypeError: Cannot read property 'toUpperCase' of undefined
    at parseFilter (http://localhost:52216/admin/Scripts/jqgrid/js/jquery.jqgrid.src.js:8924:24)
    at HTMLTableElement.<anonymous> (http://localhost:52216/admin/Scripts/jqgrid/js/jquery.jqgrid.src.js:9255:23)
    at Function.jQuery.extend.each (http://localhost:52216/admin/Scripts/jquery-1.11.2.js:384:23)
    at jQuery.fn.jQuery.each (http://localhost:52216/admin/Scripts/jquery-1.11.2.js:136:17)
    at jgrid.extend.filterToolbar (http://localhost:52216/admin/Scripts/jqgrid/js/jquery.jqgrid.src.js:8844:16)
    at $.fn.jqGrid (http://localhost:52216/admin/Scripts/jqgrid/js/jquery.jqgrid.src.js:2355:14)
    at HTMLDocument.<anonymous> (http://localhost:52216/admin/Scripts/myapp.js:797:15)
    at fire (http://localhost:52216/admin/Scripts/jquery-1.11.2.js:3143:30)
    at Object.self.add [as done] (http://localhost:52216/admin/Scripts/jquery-1.11.2.js:3189:7)
    at jQuery.fn.ready (http://localhost:52216/admin/Scripts/jquery-1.11.2.js:3423:25)


推荐答案

如果没有测试用例,很难在代码中进行更改。尽管如此,我还是尝试在8924线附近进行一些更改,以使其更安全。请尝试使用GitHub的最新资源。

It's difficult to make the changes in the code without having an test case. Nevertheless I tried to make some changes near the line 8924 to make it more safer. Please try with the latest sources from the GitHub.

这篇关于如何在最新的免费jqgrid中修复filterToolbar中的异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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