Jqgrid -- search button doesn't work with Jquery 1.8.0 or greater

发布时间:2020-06-06 02:51:12 作者:wander_bird
来源:网络 阅读:684

search functionality code:

$("#devicesTable").jqGrid('navGrid', '#pager', {
   del : false,
   add : false,
   edit : false,
   afterRefresh : function() {
       ...
   }

}, {}, {}, {}, {
   multipleSearch : true,
   multipleGroup : true,
   sopt : [ 'cn', 'eq' ]
});


I struggled with the same issue, and after I while I found the reason that jQgrid search does not work with jQuery 1.8.3:

In my jquery.jqGrid.js (v 4.3.3) i found this:

if($("#"+ $.jgrid.jqID(IDs.themodal)).html()!==null){

   showFilter($("#fbox_"+ $.jgrid.jqID(+$t.p.id)));

}

In jquery.jqGrid.min.js as follows:

if(null!==a("#"+a.jgrid.jqID(t.themodal)).html())d(a("#fbox_"+a.jgrid.jqID(+e.p.id)));


In my file it was on line 6863, but you may have to search for it, since my file may be a bit modified compared to the original.

The problem is that $([id]).html() evaluates to null in older jQuery versions, while in jQuery 1.8.0 it instead evaluates to undefined! Since (undefined !== null) is true and (null !== null) is false, the code does different things with different versions of jQuery.

What I did to fix it, and make it work with jQuery 1.8.0 was to change the comparator from !== to !=. This works since both (null != null) and (null != undefined) evaluates to true!

Hope this could be of help!


link to http://stackoverflow.com/questions/12199400/jqgrid-search-button-does-nothing


推荐阅读:
  1. vagrant之运维,搭建统一开发环境
  2. 工业互联网 AR眼镜的应用实践

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

jqgrid search button gr ue

上一篇:Apache网页优化----压缩、缓存

下一篇:spring boot的环境搭建

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》