Jqgrid--searchbuttondoesn'tworkwithJquery1.8.0orgreater

search functionality code:

创新互联是一家专注于网站设计、成都网站设计与策划设计,七星关区网站建设哪家好?创新互联做网站,专注于网站建设十载,网设计领域的专业建站公司;建站业务涵盖:七星关区等地区。七星关区做网站价格咨询:18982081108

$("#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


文章题目:Jqgrid--searchbuttondoesn'tworkwithJquery1.8.0orgreater
标题网址:http://bzwzjz.com/article/jpeodh.html

其他资讯

Copyright © 2007-2020 广东宝晨空调科技有限公司 All Rights Reserved 粤ICP备2022107769号
友情链接: 重庆外贸网站建设 网站设计制作 成都网站建设 成都企业网站制作 高端品牌网站建设 成都网站制作 专业网站建设 上市集团网站建设 成都企业网站建设 网站制作 网站建设方案 营销网站建设 成都品牌网站设计 攀枝花网站设计 做网站设计 网站制作公司 自适应网站建设 网站制作报价 成都企业网站建设公司 成都网站制作 企业手机网站建设 成都网站建设