使用
创建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)