javascript - 如何修复最新免费jqgrid中filterToolbar中的异常

标签 javascript jquery jqgrid free-jqgrid

Jqgrid过滤器工具栏是使用创建的

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

使用 github 上的最新 jqgrid 这会导致 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

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

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)

最佳答案

如果没有测试用例,很难对代码进行更改。尽管如此,我还是尝试制作 some changes 8924线附近,更安全。请尝试使用 GitHub 上的最新源。

关于javascript - 如何修复最新免费jqgrid中filterToolbar中的异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36436813/

相关文章:

javascript - Fullcalendar 远程 EventSource 正在删除所有来源

javascript - 选择性帧爆破

javascript - JQuery/Javascript 内联回调

javascript - 如果使用 jqgrid 中的内联添加按钮添加行,如何设置默认值

javascript - 使用 Chrome 的 webkit 检查器删除事件监听器

javascript - 如何在 React 中的对象之间复制嵌套状态

javascript - 在 JavaScript 中确定照片的方向?

javascript - PHP 没有为 AJAX 调用正确返回 JSON

jquery - 如何以编程方式在 jqGrid 中分页到下一页/上一页

jquery - jqGrid - 如何在编辑表单中隐藏字段